Guard all accesses to RubyVM::MJIT with defined?(RubyVM::MJIT) &&

* Otherwise those tests, etc cannot run on alternative Ruby implementations.
This commit is contained in:
Benoit Daloze 2020-12-04 16:40:02 +01:00
parent 83e983ab61
commit b4ec4a41c2
18 changed files with 42 additions and 42 deletions

View file

@ -485,7 +485,7 @@ class TestSocket < Test::Unit::TestCase
end while IO.select([r], nil, nil, 0.1).nil?
n
end
timeout = (RubyVM::MJIT.enabled? ? 120 : 30) # for --jit-wait
timeout = (defined?(RubyVM::MJIT) && RubyVM::MJIT.enabled? ? 120 : 30) # for --jit-wait
assert_equal([[s1],[],[]], IO.select([s1], nil, nil, timeout))
msg, _, _, stamp = s1.recvmsg
assert_equal("a", msg)