diff options
author | Benoit Daloze <eregontp@gmail.com> | 2018-09-07 00:24:31 +0200 |
---|---|---|
committer | Benoit Daloze <eregontp@gmail.com> | 2018-09-09 16:38:22 +0200 |
commit | f81de9af0de9b77f1c2c2335a103f0638d0668b4 (patch) | |
tree | 4fcd05d160be2b7f079000979f7c0c30321d3a9b | |
parent | ed924f83a22b6b633223a0ccadbd2f4c497db0cb (diff) | |
download | bundler-f81de9af0de9b77f1c2c2335a103f0638d0668b4.tar.gz |
Adapt RubyVersion spec now that it fallbacks to RUBY_ENGINE_VERSION
* stub RUBY_ENGINE in specs, Bundler.ruby_engine no longer exists.
-rw-r--r-- | spec/bundler/ruby_version_spec.rb | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/spec/bundler/ruby_version_spec.rb b/spec/bundler/ruby_version_spec.rb index 3f30821b5c..46a1b2918b 100644 --- a/spec/bundler/ruby_version_spec.rb +++ b/spec/bundler/ruby_version_spec.rb @@ -443,7 +443,7 @@ RSpec.describe "Bundler::RubyVersion and its subclasses" do context "engine is ruby" do before do stub_const("RUBY_VERSION", "2.2.4") - allow(Bundler).to receive(:ruby_engine).and_return("ruby") + stub_const("RUBY_ENGINE", "ruby") end it "should return a copy of the value of RUBY_VERSION" do @@ -479,11 +479,11 @@ RSpec.describe "Bundler::RubyVersion and its subclasses" do context "engine is some other ruby engine" do before do stub_const("RUBY_ENGINE", "not_supported_ruby_engine") - allow(Bundler).to receive(:ruby_engine).and_return("not_supported_ruby_engine") + stub_const("RUBY_ENGINE_VERSION", "1.2.3") end - it "should raise a BundlerError with a 'not recognized' message" do - expect { bundler_system_ruby_version.engine_versions }.to raise_error(Bundler::BundlerError, "RUBY_ENGINE value not_supported_ruby_engine is not recognized") + it "returns RUBY_ENGINE_VERSION" do + expect(bundler_system_ruby_version.engine_versions).to eq(["1.2.3"]) end end end |