Fix MonitorMixin when the super's initialize has kwargs
This commit is contained in:
parent
1fb4e28002
commit
8d2333019a
Notes:
git
2020-07-18 08:37:58 +09:00
@ -220,7 +220,7 @@ module MonitorMixin
|
|||||||
# Use <tt>extend MonitorMixin</tt> or <tt>include MonitorMixin</tt> instead
|
# Use <tt>extend MonitorMixin</tt> or <tt>include MonitorMixin</tt> instead
|
||||||
# of this constructor. Have look at the examples above to understand how to
|
# of this constructor. Have look at the examples above to understand how to
|
||||||
# use this module.
|
# use this module.
|
||||||
def initialize(*args)
|
def initialize(...)
|
||||||
super
|
super
|
||||||
mon_initialize
|
mon_initialize
|
||||||
end
|
end
|
||||||
|
@ -236,6 +236,22 @@ class TestMonitor < Test::Unit::TestCase
|
|||||||
assert NewCondTest.new.cond.instance_variable_get(:@monitor) != nil
|
assert NewCondTest.new.cond.instance_variable_get(:@monitor) != nil
|
||||||
end
|
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
|
def test_timedwait
|
||||||
cond = @monitor.new_cond
|
cond = @monitor.new_cond
|
||||||
b = "foo"
|
b = "foo"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user