assert_ractor
tweak. Thanks Nobu
This commit is contained in:
parent
f70b894b88
commit
b1b6dbfdc3
@ -331,14 +331,13 @@ eom
|
|||||||
end
|
end
|
||||||
|
|
||||||
# Run Ractor-related test without influencing the main test suite
|
# Run Ractor-related test without influencing the main test suite
|
||||||
def assert_ractor(src, args: [], file: nil, line: nil, ignore_stderr: nil, **opt)
|
def assert_ractor(src, args: [], require: nil, file: nil, line: nil, ignore_stderr: nil, **opt)
|
||||||
return unless defined?(Ractor)
|
return unless defined?(Ractor)
|
||||||
|
|
||||||
if (req = opt.delete(:require))
|
require = "require #{require.inspect}" if require
|
||||||
req = "require #{req.inspect}"
|
|
||||||
end
|
|
||||||
assert_separately(args, file, line, <<~RUBY, ignore_stderr: ignore_stderr, **opt)
|
assert_separately(args, file, line, <<~RUBY, ignore_stderr: ignore_stderr, **opt)
|
||||||
#{req}
|
#{require}
|
||||||
previous_verbose = $VERBOSE
|
previous_verbose = $VERBOSE
|
||||||
$VERBOSE = nil
|
$VERBOSE = nil
|
||||||
Ractor.new {} # trigger initial warning
|
Ractor.new {} # trigger initial warning
|
||||||
|
Loading…
x
Reference in New Issue
Block a user