summaryrefslogtreecommitdiff
path: root/test/ruby/test_object.rb
diff options
context:
space:
mode:
authormame <mame@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-10-09 13:16:07 +0000
committermame <mame@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-10-09 13:16:07 +0000
commit270f2f15be57fd13905cad48259af45670ae9fb1 (patch)
treee4715ce5c7d5acba079341a5cfd4d8838479cf87 /test/ruby/test_object.rb
parentae4bc66b6412b35ac1f60d99d2402ae9293cf6ec (diff)
* test/ruby/test_module.rb (test_remove_class_variable): add a test
for Class#remove_class_variable. * test/ruby/test_object.rb (test_remove_instance_variable): add a test for Object#remove_instance_variable. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19728 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/ruby/test_object.rb')
-rw-r--r--test/ruby/test_object.rb7
1 files changed, 7 insertions, 0 deletions
diff --git a/test/ruby/test_object.rb b/test/ruby/test_object.rb
index 5190eb69e5..2116c6a216 100644
--- a/test/ruby/test_object.rb
+++ b/test/ruby/test_object.rb
@@ -170,6 +170,13 @@ class TestObject < Test::Unit::TestCase
assert_raise(NameError) { o.instance_variable_defined?(:foo) }
end
+ def test_remove_instance_variable
+ o = Object.new
+ o.instance_eval { @foo = :foo }
+ o.instance_eval { remove_instance_variable(:@foo) }
+ assert_equal(false, o.instance_variable_defined?(:@foo))
+ end
+
def test_convert_type
o = Object.new
def o.to_s; 1; end