summaryrefslogtreecommitdiff
path: root/spec/ruby/command_line
diff options
context:
space:
mode:
Diffstat (limited to 'spec/ruby/command_line')
-rw-r--r--spec/ruby/command_line/feature_spec.rb11
1 files changed, 9 insertions, 2 deletions
diff --git a/spec/ruby/command_line/feature_spec.rb b/spec/ruby/command_line/feature_spec.rb
index fa2a82cb4b..95e21de847 100644
--- a/spec/ruby/command_line/feature_spec.rb
+++ b/spec/ruby/command_line/feature_spec.rb
@@ -39,10 +39,17 @@ describe "The --enable and --disable flags" do
ruby_version_is "2.6" do
it "can be used with jit" do
- ruby_exe("p RubyVM::MJIT.enabled?", options: "--enable=jit").chomp.should == "true"
ruby_exe("p RubyVM::MJIT.enabled?", options: "--disable=jit").chomp.should == "false"
- ruby_exe("p RubyVM::MJIT.enabled?", options: "--enable-jit").chomp.should == "true"
ruby_exe("p RubyVM::MJIT.enabled?", options: "--disable-jit").chomp.should == "false"
+
+ warning = IO.popen([RbConfig.ruby, '--jit-warning', '-e', ''], err: [:child, :out], &:read)
+ if warning.include?('warning: MJIT support is disabled.') # ./configure --disable-jit-support
+ ruby_exe("p RubyVM::MJIT.enabled?", options: "--enable=jit").chomp.should == "false"
+ ruby_exe("p RubyVM::MJIT.enabled?", options: "--enable-jit").chomp.should == "false"
+ else
+ ruby_exe("p RubyVM::MJIT.enabled?", options: "--enable=jit").chomp.should == "true"
+ ruby_exe("p RubyVM::MJIT.enabled?", options: "--enable-jit").chomp.should == "true"
+ end
end
end