Skip to content

Commit e6362f8

Browse files
eregonandrykonchin
authored andcommitted
Add spec for def foo(**nil); super; end
1 parent d728970 commit e6362f8

1 file changed

Lines changed: 14 additions & 0 deletions

File tree

language/super_spec.rb

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -461,4 +461,18 @@ def obj.foobar(array)
461461
@all.foo('a', b: 'b').should == [['a'], {b: 'b'}]
462462
end
463463
end
464+
465+
it "works in method definitions using **nil" do
466+
parent = Class.new do
467+
def m(*args, **kwargs)
468+
[args, kwargs]
469+
end
470+
end
471+
child = Class.new(parent) do
472+
def m(*args, **nil)
473+
super
474+
end
475+
end
476+
child.new.m(1, 2).should == [[1, 2], {}]
477+
end
464478
end

0 commit comments

Comments
 (0)