summaryrefslogtreecommitdiff
path: root/test/ruby/test_struct.rb
diff options
context:
space:
mode:
Diffstat (limited to 'test/ruby/test_struct.rb')
-rw-r--r--test/ruby/test_struct.rb5
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