summaryrefslogtreecommitdiff
path: root/test/monitor
diff options
context:
space:
mode:
authorMasataka Pocke Kuwabara <kuwabara@pocke.me>2020-07-11 16:01:05 +0900
committerJeremy Evans <code@jeremyevans.net>2020-07-17 16:37:18 -0700
commit8d2333019abb1f8ad882dadf9096f81e9f427c6e (patch)
treeffe4a76e48d0c0de9ea1aa6a1711814909a2bc50 /test/monitor
parent1fb4e28002327c1224c3ed32783160b011f14747 (diff)
Fix MonitorMixin when the super's initialize has kwargs
Notes
Notes: Merged: https://github.com/ruby/ruby/pull/3310
Diffstat (limited to 'test/monitor')
-rw-r--r--test/monitor/test_monitor.rb16
1 files changed, 16 insertions, 0 deletions
diff --git a/test/monitor/test_monitor.rb b/test/monitor/test_monitor.rb
index 721c848..734b639 100644
--- a/test/monitor/test_monitor.rb
+++ b/test/monitor/test_monitor.rb
@@ -236,6 +236,22 @@ class TestMonitor < Test::Unit::TestCase
assert NewCondTest.new.cond.instance_variable_get(:@monitor) != nil
end
+ class KeywordInitializeParent
+ def initialize(x:)
+ end
+ end
+
+ class KeywordInitializeChild < KeywordInitializeParent
+ include MonitorMixin
+ def initialize
+ super(x: 1)
+ end
+ end
+
+ def test_initialize_with_keyword_arg
+ assert KeywordInitializeChild.new
+ end
+
def test_timedwait
cond = @monitor.new_cond
b = "foo"