summaryrefslogtreecommitdiff
path: root/test/ruby/test_keyword.rb
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-12-04 08:50:29 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-12-04 08:50:29 +0000
commitf5ef84cb5eae9948e7011a9e6020dd4a8aeb246c (patch)
tree63a8497d0d9876a46ae9d96fef65ce33c8167b62 /test/ruby/test_keyword.rb
parentb62e32201727907e465edeb1f18b72544d7c2889 (diff)
class.c: missing unknown_keyword_error
* class.c (rb_get_kwargs): when values are stored, corresponding keys have been remove from the keyword hash, and the hash should be empty in that case. [ruby-dev:49893] [Bug #13004] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56981 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/ruby/test_keyword.rb')
-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 1a7955dbcf..bcb93a6348 100644
--- a/test/ruby/test_keyword.rb
+++ b/test/ruby/test_keyword.rb
@@ -546,6 +546,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]'