summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authornagachika <nagachika@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-01-16 19:21:32 +0000
committernagachika <nagachika@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-01-16 19:21:32 +0000
commitbc059aa6d5a5987628b19108b5448915ae3012af (patch)
tree708aa216286a914b093b016cb67a21f069d6803b /test
parente9ab3c7ccae115d623339f0382289d66a8621ec9 (diff)
merge revision(s) 56980,56981: [Backport #13004]
extension.rdoc: fix rb_get_kwargs [ci skip] * doc/extension.rdoc: [DOC] optional keyword arguments are defaulted to Qundef. ignored keys are kept in the hash but a new Hash is not created. [ruby-dev:49893] [Bug #13004] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_3@57346 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
-rw-r--r--test/ruby/test_keyword.rb7
1 files changed, 7 insertions, 0 deletions
diff --git a/test/ruby/test_keyword.rb b/test/ruby/test_keyword.rb
index b8ca84c27e..6c38ff472e 100644
--- a/test/ruby/test_keyword.rb
+++ b/test/ruby/test_keyword.rb
@@ -541,6 +541,13 @@ class TestKeywordArguments < Test::Unit::TestCase
}
end
+ def test_unknown_keyword
+ bug13004 = '[ruby-dev:49893] [Bug #13004]'
+ assert_raise_with_message(ArgumentError, /unknown keyword: invalid-argument/, bug13004) {
+ [].sample(random: nil, "invalid-argument": nil)
+ }
+ end
+
def test_super_with_anon_restkeywords
bug10659 = '[ruby-core:67157] [Bug #10659]'