summaryrefslogtreecommitdiff
path: root/test/ostruct
diff options
context:
space:
mode:
Diffstat (limited to 'test/ostruct')
-rw-r--r--test/ostruct/test_ostruct.rb10
1 files changed, 10 insertions, 0 deletions
diff --git a/test/ostruct/test_ostruct.rb b/test/ostruct/test_ostruct.rb
index a472509..3c1d574 100644
--- a/test/ostruct/test_ostruct.rb
+++ b/test/ostruct/test_ostruct.rb
@@ -68,6 +68,16 @@ class TC_OpenStruct < Test::Unit::TestCase
assert_not_respond_to(o, :a, bug)
assert_not_respond_to(o, :a=, bug)
assert_equal(a, 'a')
+ s = Object.new
+ def s.to_sym
+ :foo
+ end
+ o[s] = true
+ assert_respond_to(o, :foo)
+ assert_respond_to(o, :foo=)
+ o.delete_field s
+ assert_not_respond_to(o, :foo)
+ assert_not_respond_to(o, :foo=)
end
def test_setter