summaryrefslogtreecommitdiff
path: root/tool
diff options
context:
space:
mode:
authorMarc-Andre Lafortune <github@marc-andre.ca>2020-12-19 22:37:27 -0500
committerMarc-Andre Lafortune <github@marc-andre.ca>2020-12-19 22:37:27 -0500
commitb1b6dbfdc3abaca44e971979328fd396b424c32a (patch)
treeb20478671c1442178c1f45d90cb7970e91429d20 /tool
parentf70b894b8829c064e39646c9b5f6d304d13bb16d (diff)
`assert_ractor` tweak. Thanks Nobu
Diffstat (limited to 'tool')
-rw-r--r--tool/lib/test/unit/core_assertions.rb9
1 files changed, 4 insertions, 5 deletions
diff --git a/tool/lib/test/unit/core_assertions.rb b/tool/lib/test/unit/core_assertions.rb
index d17e3d725a..97b9b392f9 100644
--- a/tool/lib/test/unit/core_assertions.rb
+++ b/tool/lib/test/unit/core_assertions.rb
@@ -331,14 +331,13 @@ eom
end
# 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)
- if (req = opt.delete(:require))
- req = "require #{req.inspect}"
- end
+ require = "require #{require.inspect}" if require
+
assert_separately(args, file, line, <<~RUBY, ignore_stderr: ignore_stderr, **opt)
- #{req}
+ #{require}
previous_verbose = $VERBOSE
$VERBOSE = nil
Ractor.new {} # trigger initial warning