Update the error message format in bundler

This commit is contained in:
Yusuke Endoh 2024-02-15 14:09:41 +09:00
Родитель d5c16ddfcb
Коммит 92eab382e4
3 изменённых файлов: 4 добавлений и 5 удалений

Просмотреть файл

@ -7,7 +7,7 @@ RSpec.describe Bundler do
describe "#load_marshal" do describe "#load_marshal" do
it "is a private method and raises an error" do it "is a private method and raises an error" do
data = Marshal.dump(Bundler) data = Marshal.dump(Bundler)
expect { Bundler.load_marshal(data) }.to raise_error(NoMethodError, /private method `load_marshal' called/) expect { Bundler.load_marshal(data) }.to raise_error(NoMethodError, /private method [`']load_marshal' called/)
end end
it "loads any data" do it "loads any data" do

Просмотреть файл

@ -831,8 +831,7 @@ RSpec.describe "bundle exec" do
let(:executable) { super() << "\nraise 'ERROR'" } let(:executable) { super() << "\nraise 'ERROR'" }
let(:exit_code) { 1 } let(:exit_code) { 1 }
let(:expected_err) do let(:expected_err) do
"bundler: failed to load command: #{path} (#{path})" \ /\Abundler: failed to load command: #{Regexp.quote(path.to_s)} \(#{Regexp.quote(path.to_s)}\)\n#{Regexp.quote(path.to_s)}:10:in [`']<top \(required\)>': ERROR \(RuntimeError\)/
"\n#{path}:10:in `<top (required)>': ERROR (RuntimeError)"
end end
it "runs like a normally executed executable" do it "runs like a normally executed executable" do
@ -840,7 +839,7 @@ RSpec.describe "bundle exec" do
subject subject
expect(exitstatus).to eq(exit_code) expect(exitstatus).to eq(exit_code)
expect(err).to start_with(expected_err) expect(err).to match(expected_err)
expect(out).to eq(expected) expect(out).to eq(expected)
end end
end end

Просмотреть файл

@ -1532,7 +1532,7 @@ end
RUBY RUBY
expect(last_command.stdboth).not_to include "FAIL" expect(last_command.stdboth).not_to include "FAIL"
expect(err).to include "private method `require'" expect(err).to match /private method [`']require'/
end end
it "memoizes initial set of specs when requiring bundler/setup, so that even if further code mutates dependencies, Bundler.definition.specs is not affected" do it "memoizes initial set of specs when requiring bundler/setup, so that even if further code mutates dependencies, Bundler.definition.specs is not affected" do