summaryrefslogtreecommitdiff
path: root/test/ruby/test_keyword.rb
diff options
context:
space:
mode:
Diffstat (limited to 'test/ruby/test_keyword.rb')
-rw-r--r--test/ruby/test_keyword.rb20
1 files changed, 20 insertions, 0 deletions
diff --git a/test/ruby/test_keyword.rb b/test/ruby/test_keyword.rb
index d24cd5b0fc..82d6407fe3 100644
--- a/test/ruby/test_keyword.rb
+++ b/test/ruby/test_keyword.rb
@@ -539,4 +539,24 @@ class TestKeywordArguments < Test::Unit::TestCase
o.foo {raise "unreachable"}
}
end
+
+ def test_super_with_anon_restkeywords
+ bug10659 = '[ruby-core:67157] [Bug #10659]'
+
+ foo = Class.new do
+ def foo(**h)
+ h
+ end
+ end
+
+ class << (obj = foo.new)
+ def foo(bar: "bar", **)
+ super
+ end
+ end
+
+ assert_nothing_raised(TypeError, bug10659) {
+ assert_equal({:bar => "bar"}, obj.foo, bug10659)
+ }
+ end
end