aboutsummaryrefslogtreecommitdiffstats
path: root/test/ostruct
diff options
context:
space:
mode:
authormarcandre <marcandre@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-10-23 15:13:38 +0000
committermarcandre <marcandre@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-10-23 15:13:38 +0000
commit99d5d90f2f8d61d37b6eb110b54d84a08de5a4d1 (patch)
treeb2815647f44ee1c99ed117a9a94b43e389912928 /test/ostruct
parentb9e18abe4a881a638d0c6cfbbffeacea43813e86 (diff)
downloadruby-99d5d90f2f8d61d37b6eb110b54d84a08de5a4d1.tar.gz
* lib/ostruct.rb (OpenStruct#delete): Use the converted argument.
Patch by Kenichi Kamiya. [Fixes GH-383] * test/ostruct/test_ostruct.rb: Added tests for above. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43403 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
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 a472509b88..3c1d574e32 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