diff options
| -rw-r--r-- | spec/bundler/commands/exec_spec.rb | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/spec/bundler/commands/exec_spec.rb b/spec/bundler/commands/exec_spec.rb index 62421410ed..ec8f4c5b89 100644 --- a/spec/bundler/commands/exec_spec.rb +++ b/spec/bundler/commands/exec_spec.rb @@ -193,7 +193,10 @@ RSpec.describe "bundle exec" do end context "with default gems" do - let(:default_erb_version) { ruby "gem 'erb', '< 999999'; require 'erb/version'; puts Erb::VERSION", raise_on_error: false } + # TODO: Switch to ERB::VERSION once Ruby 3.4 support is dropped, so all + # supported rubies include an `erb` gem version where `ERB::VERSION` is + # public + let(:default_erb_version) { ruby "require 'erb/version'; puts ERB.const_get(:VERSION)" } context "when not specified in Gemfile" do before do @@ -201,9 +204,9 @@ RSpec.describe "bundle exec" do end it "uses version provided by ruby" do - bundle "exec erb --version" + bundle "exec erb --version", artifice: nil - expect(out).to include(default_erb_version) + expect(stdboth).to eq(default_erb_version) end end @@ -226,8 +229,7 @@ RSpec.describe "bundle exec" do it "uses version specified" do bundle "exec erb --version", artifice: nil - expect(out).to eq(specified_erb_version) - expect(err).to be_empty + expect(stdboth).to eq(specified_erb_version) end end @@ -249,13 +251,12 @@ RSpec.describe "bundle exec" do source "https://gem.repo2" gem "gem_depending_on_old_erb" G - - bundle "exec erb --version", artifice: nil end it "uses resolved version" do - expect(out).to eq(indirect_erb_version) - expect(err).to be_empty + bundle "exec erb --version", artifice: nil + + expect(stdboth).to eq(indirect_erb_version) end end end |
