diff options
author | Nobuyoshi Nakada <nobu@ruby-lang.org> | 2022-03-17 18:54:49 +0900 |
---|---|---|
committer | Nobuyoshi Nakada <nobu@ruby-lang.org> | 2022-03-17 20:53:41 +0900 |
commit | e660b934b98943826f888f2b73f773c6411cd199 (patch) | |
tree | 0abbca3c07d10cc1c9a2ea2ac0e4524a194d5e33 /test/ruby/test_struct.rb | |
parent | e9553a8cac633067e0da08d78e2200944d33bfdd (diff) |
A positional Hash is not keyword arguments [Bug #18632]
Diffstat (limited to 'test/ruby/test_struct.rb')
-rw-r--r-- | test/ruby/test_struct.rb | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/test/ruby/test_struct.rb b/test/ruby/test_struct.rb index 5b7b8c7255..78a81c5200 100644 --- a/test/ruby/test_struct.rb +++ b/test/ruby/test_struct.rb @@ -100,8 +100,9 @@ module TestStruct assert_equal([:utime, :stime, :cutime, :cstime], Process.times.members) end - def test_struct_new_with_empty_hash - assert_equal({:a=>1}, Struct.new(:a, {}).new({:a=>1}).a) + def test_struct_new_with_hash + assert_raise_with_message(TypeError, /not a symbol/) {Struct.new(:a, {})} + assert_raise_with_message(TypeError, /not a symbol/) {Struct.new(:a, {name: "b"})} end def test_struct_new_with_keyword_init |