From 90dcdaee15f51f96b72a5b614e5e44f7501e2899 Mon Sep 17 00:00:00 2001 From: mame Date: Thu, 9 Oct 2008 13:16:07 +0000 Subject: * 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: http://svn.ruby-lang.org/repos/ruby/trunk@19728 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- test/ruby/test_object.rb | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'test/ruby/test_object.rb') diff --git a/test/ruby/test_object.rb b/test/ruby/test_object.rb index 5190eb69e..2116c6a21 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 -- cgit