diff options
author | Peter Zhu <[email protected]> | 2023-11-01 08:25:09 -0400 |
---|---|---|
committer | Peter Zhu <[email protected]> | 2023-11-01 08:25:09 -0400 |
commit | 9c6dd25093f49d926ac71c3b91e1320d4bbc553a (patch) | |
tree | b27adec6caae1bbacc95a92c29f035dc18501444 /test/ruby/test_shapes.rb | |
parent | a1e24ab4841b8032b274bfd49c30adfdeb82b859 (diff) |
Fix removing non-existent ivar for too complex
Diffstat (limited to 'test/ruby/test_shapes.rb')
-rw-r--r-- | test/ruby/test_shapes.rb | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/test/ruby/test_shapes.rb b/test/ruby/test_shapes.rb index 228e9a4913..7e3a77fdf2 100644 --- a/test/ruby/test_shapes.rb +++ b/test/ruby/test_shapes.rb @@ -265,8 +265,13 @@ class TestShapes < Test::Unit::TestCase c = Class.new c.instance_variable_set(:@a, 1) assert_equal(1, c.instance_variable_get(:@a)) + c.remove_instance_variable(:@a) assert_nil(c.instance_variable_get(:@a)) + + assert_raise(NameError) do + c.remove_instance_variable(:@a) + end end; end @@ -290,6 +295,10 @@ class TestShapes < Test::Unit::TestCase tc.remove_instance_variable(:@a) assert_nil(tc.instance_variable_get(:@a)) + + assert_raise(NameError) do + tc.remove_instance_variable(:@a) + end end; end |