summaryrefslogtreecommitdiff
path: root/test/ruby/test_keyword.rb
diff options
context:
space:
mode:
author卜部昌平 <shyouhei@ruby-lang.org>2019-10-28 14:36:28 +0900
committer卜部昌平 <shyouhei@ruby-lang.org>2019-10-28 14:38:05 +0900
commitcc5580f175bb55c9a1d7574c1861f405ee972617 (patch)
treea943ed1d5bbb1e9810f5bdba49526bdb50f1f3db /test/ruby/test_keyword.rb
parenta72cb6b11d777c2268831df4f21ab56851db425c (diff)
fix bug in keyword + protected combination
Test included for the situation formerly was not working.
Diffstat (limited to 'test/ruby/test_keyword.rb')
-rw-r--r--test/ruby/test_keyword.rb16
1 files changed, 16 insertions, 0 deletions
diff --git a/test/ruby/test_keyword.rb b/test/ruby/test_keyword.rb
index 28a80fd198..bbb107dedd 100644
--- a/test/ruby/test_keyword.rb
+++ b/test/ruby/test_keyword.rb
@@ -4859,4 +4859,20 @@ class TestKeywordArgumentsSymProcRefinements < Test::Unit::TestCase
assert_equal([1, h3], c.call(**h3, &:m2))
assert_equal([1, h3], c.call(a: 1, **h2, &:m2))
end
+
+ def test_protected_kwarg
+ mock = Class.new do
+ def foo
+ bar('x', y: 'z')
+ end
+ protected
+ def bar(x, y)
+ nil
+ end
+ end
+
+ assert_nothing_raised do
+ mock.new.foo
+ end
+ end
end