summaryrefslogtreecommitdiff
path: root/test/ruby
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-10-22 18:41:54 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-10-22 18:41:54 +0000
commit67121b506099a96c103cf67611c1ca53fb47292b (patch)
tree5eb75ed2160b9506707a89c546e771561657c3cd /test/ruby
parent052c85da9643fcfb4e5f43e9ff688dcec7d3f7e2 (diff)
class.c: delete expected keywords directly
* class.c (unknown_keyword_error): delete expected keywords directly from raw table, so that the given block is not called. [ruby-core:65837] [Bug #10413] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48102 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/ruby')
-rw-r--r--test/ruby/test_keyword.rb15
1 files changed, 15 insertions, 0 deletions
diff --git a/test/ruby/test_keyword.rb b/test/ruby/test_keyword.rb
index 6e9cd2dbfe..95cbcc209c 100644
--- a/test/ruby/test_keyword.rb
+++ b/test/ruby/test_keyword.rb
@@ -514,4 +514,19 @@ class TestKeywordArguments < Test::Unit::TestCase
assert_nothing_raised(bug) {eval("def a(hoge:); end")}
end;
end
+
+ def test_unknown_keyword_with_block
+ bug10413 = '[ruby-core:65837] [Bug #10413]'
+ class << (o = Object.new)
+ def bar(k2: 'v2')
+ end
+
+ def foo
+ bar(k1: 1)
+ end
+ end
+ assert_raise_with_message(ArgumentError, /unknown keyword: k1/, bug10413) {
+ o.foo {raise "unreachable"}
+ }
+ end
end