diff options
author | Yusuke Endoh <mame@ruby-lang.org> | 2024-02-15 14:09:41 +0900 |
---|---|---|
committer | Yusuke Endoh <mame@ruby-lang.org> | 2024-02-15 18:42:31 +0900 |
commit | 92eab382e40ae5d853ab3d84940336e407d58754 (patch) | |
tree | 6ad99a94ec5690f8fefbe2a9e6f85ab7e271330d /spec/bundler | |
parent | d5c16ddfcb6c4cbb0209d66118ac23c7cb6c5149 (diff) |
Update the error message format in bundler
Diffstat (limited to 'spec/bundler')
-rw-r--r-- | spec/bundler/bundler/bundler_spec.rb | 2 | ||||
-rw-r--r-- | spec/bundler/commands/exec_spec.rb | 5 | ||||
-rw-r--r-- | spec/bundler/runtime/setup_spec.rb | 2 |
3 files changed, 4 insertions, 5 deletions
diff --git a/spec/bundler/bundler/bundler_spec.rb b/spec/bundler/bundler/bundler_spec.rb index 1ccdbee316..6a2e435e54 100644 --- a/spec/bundler/bundler/bundler_spec.rb +++ b/spec/bundler/bundler/bundler_spec.rb @@ -7,7 +7,7 @@ RSpec.describe Bundler do describe "#load_marshal" do it "is a private method and raises an error" do 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 it "loads any data" do diff --git a/spec/bundler/commands/exec_spec.rb b/spec/bundler/commands/exec_spec.rb index 0ff137cae3..9f5f12739a 100644 --- a/spec/bundler/commands/exec_spec.rb +++ b/spec/bundler/commands/exec_spec.rb @@ -831,8 +831,7 @@ RSpec.describe "bundle exec" do let(:executable) { super() << "\nraise 'ERROR'" } let(:exit_code) { 1 } let(:expected_err) do - "bundler: failed to load command: #{path} (#{path})" \ - "\n#{path}:10:in `<top (required)>': ERROR (RuntimeError)" + /\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\)/ end it "runs like a normally executed executable" do @@ -840,7 +839,7 @@ RSpec.describe "bundle exec" do subject expect(exitstatus).to eq(exit_code) - expect(err).to start_with(expected_err) + expect(err).to match(expected_err) expect(out).to eq(expected) end end diff --git a/spec/bundler/runtime/setup_spec.rb b/spec/bundler/runtime/setup_spec.rb index d51e63e17b..8df2a57f96 100644 --- a/spec/bundler/runtime/setup_spec.rb +++ b/spec/bundler/runtime/setup_spec.rb @@ -1532,7 +1532,7 @@ end RUBY expect(last_command.stdboth).not_to include "FAIL" - expect(err).to include "private method `require'" + expect(err).to match /private method [`']require'/ 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 |