summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorusa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-03-25 18:13:17 +0000
committerusa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-03-25 18:13:17 +0000
commitd41018464386c1ce686a65af03fb711a9af1baa1 (patch)
tree1aabc37864c9f6216539240165e29154f7c6573f /test
parentd014f463cf6d5dd51aa2ce56385fc08ac5c121af (diff)
merge revision(s) 57024: [Backport #13015]
vm.c: check type of hash to merge * vm.c (core_hash_merge): check the type of the target hash to merge. [ruby-core:78536] [Bug #13015] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_2@58116 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
-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 df366845fe..3454c72d05 100644
--- a/test/ruby/test_keyword.rb
+++ b/test/ruby/test_keyword.rb
@@ -615,4 +615,24 @@ class TestKeywordArguments < Test::Unit::TestCase
assert_equal(x, result)
assert_kind_of(klass, result, bug12884)
end
+
+ def test_kwrest_overwritten
+ bug13015 = '[ruby-core:78536] [Bug #13015]'
+
+ klass = EnvUtil.labeled_class("Parent") do
+ def initialize(d:)
+ end
+ end
+
+ klass = EnvUtil.labeled_class("Child", klass) do
+ def initialize(d:, **h)
+ h = [2, 3]
+ super
+ end
+ end
+
+ assert_raise_with_message(TypeError, /expected Hash/, bug13015) do
+ klass.new(d: 4)
+ end
+ end
end