[前][次][番号順一覧][スレッド一覧]

ruby-changes:64365

From: Marc-Andre <ko1@a...>
Date: Sun, 20 Dec 2020 12:38:13 +0900 (JST)
Subject: [ruby-changes:64365] b1b6dbfdc3 (master): `assert_ractor` tweak. Thanks Nobu

https://git.ruby-lang.org/ruby.git/commit/?id=b1b6dbfdc3

From b1b6dbfdc3abaca44e971979328fd396b424c32a Mon Sep 17 00:00:00 2001
From: Marc-Andre Lafortune <github@m...>
Date: Sat, 19 Dec 2020 22:37:27 -0500
Subject: `assert_ractor` tweak. Thanks Nobu


diff --git a/tool/lib/test/unit/core_assertions.rb b/tool/lib/test/unit/core_assertions.rb
index d17e3d7..97b9b39 100644
--- a/tool/lib/test/unit/core_assertions.rb
+++ b/tool/lib/test/unit/core_assertions.rb
@@ -331,14 +331,13 @@ eom https://github.com/ruby/ruby/blob/trunk/tool/lib/test/unit/core_assertions.rb#L331
       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
-- 
cgit v0.10.2


--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]