summaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
Diffstat (limited to 'spec')
-rw-r--r--spec/bundler/bundler/ruby_version_spec.rb20
-rw-r--r--spec/bundler/support/hax.rb4
-rw-r--r--spec/bundler/support/platforms.rb2
3 files changed, 8 insertions, 18 deletions
diff --git a/spec/bundler/bundler/ruby_version_spec.rb b/spec/bundler/bundler/ruby_version_spec.rb
index 3ac7d9ef3a..ef1a5fe575 100644
--- a/spec/bundler/bundler/ruby_version_spec.rb
+++ b/spec/bundler/bundler/ruby_version_spec.rb
@@ -426,22 +426,12 @@ RSpec.describe "Bundler::RubyVersion and its subclasses" do
end
describe "#engine" do
- context "RUBY_ENGINE is defined" do
- before { stub_const("RUBY_ENGINE", "jruby") }
- before { stub_const("JRUBY_VERSION", "2.1.1") }
+ before { stub_const("RUBY_ENGINE", "jruby") }
+ before { stub_const("JRUBY_VERSION", "2.1.1") }
- it "should return a copy of the value of RUBY_ENGINE" do
- expect(subject.engine).to eq("jruby")
- expect(subject.engine).to_not be(RUBY_ENGINE)
- end
- end
-
- context "RUBY_ENGINE is not defined" do
- before { stub_const("RUBY_ENGINE", nil) }
-
- it "should return the string 'ruby'" do
- expect(subject.engine).to eq("ruby")
- end
+ it "should return a copy of the value of RUBY_ENGINE" do
+ expect(subject.engine).to eq("jruby")
+ expect(subject.engine).to_not be(RUBY_ENGINE)
end
end
diff --git a/spec/bundler/support/hax.rb b/spec/bundler/support/hax.rb
index 202e8dcc32..826fbbcc0f 100644
--- a/spec/bundler/support/hax.rb
+++ b/spec/bundler/support/hax.rb
@@ -40,7 +40,7 @@ end
class Object
if ENV["BUNDLER_SPEC_RUBY_ENGINE"]
- if defined?(RUBY_ENGINE) && RUBY_ENGINE != "jruby" && ENV["BUNDLER_SPEC_RUBY_ENGINE"] == "jruby"
+ if RUBY_ENGINE != "jruby" && ENV["BUNDLER_SPEC_RUBY_ENGINE"] == "jruby"
begin
# this has to be done up front because psych will try to load a .jar
# if it thinks its on jruby
@@ -50,7 +50,7 @@ class Object
end
end
- remove_const :RUBY_ENGINE if defined?(RUBY_ENGINE)
+ remove_const :RUBY_ENGINE
RUBY_ENGINE = ENV["BUNDLER_SPEC_RUBY_ENGINE"]
if RUBY_ENGINE == "jruby"
diff --git a/spec/bundler/support/platforms.rb b/spec/bundler/support/platforms.rb
index caac7734bf..153704e666 100644
--- a/spec/bundler/support/platforms.rb
+++ b/spec/bundler/support/platforms.rb
@@ -65,7 +65,7 @@ module Spec
end
def local_ruby_engine
- ENV["BUNDLER_SPEC_RUBY_ENGINE"] || (defined?(RUBY_ENGINE) ? RUBY_ENGINE : "ruby")
+ ENV["BUNDLER_SPEC_RUBY_ENGINE"] || RUBY_ENGINE
end
def local_engine_version