summaryrefslogtreecommitdiff
path: root/test/ostruct/test_ostruct.rb
diff options
context:
space:
mode:
Diffstat (limited to 'test/ostruct/test_ostruct.rb')
-rw-r--r--test/ostruct/test_ostruct.rb3
1 files changed, 3 insertions, 0 deletions
diff --git a/test/ostruct/test_ostruct.rb b/test/ostruct/test_ostruct.rb
index f8d184b011..d2aad4428f 100644
--- a/test/ostruct/test_ostruct.rb
+++ b/test/ostruct/test_ostruct.rb
@@ -110,6 +110,9 @@ class TC_OpenStruct < Test::Unit::TestCase
assert_equal(:foobar, o.delete_field(s) { :baz })
assert_equal(42, OpenStruct.new(foo: 42).delete_field(:foo) { :bug })
+
+ o = OpenStruct.new(block_given?: 42)
+ assert_raise(NameError) { o.delete_field(:foo) }
end
def test_setter