From d7924273014a183e86538f33f0f52ceade10cd46 Mon Sep 17 00:00:00 2001 From: Jeremy Kemper Date: Mon, 21 Nov 2005 07:29:39 +0000 Subject: r3239@asus: jeremy | 2005-11-20 23:21:37 -0800 Test for absence of instance vars rather than nil so we don't get a warning. git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@3133 5ecf4fe2-1ee6-0310-87b1-e25e094e27de --- activesupport/test/core_ext/object_and_class_ext_test.rb | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'activesupport/test/core_ext') diff --git a/activesupport/test/core_ext/object_and_class_ext_test.rb b/activesupport/test/core_ext/object_and_class_ext_test.rb index 4a554e7602..25420b7f6f 100644 --- a/activesupport/test/core_ext/object_and_class_ext_test.rb +++ b/activesupport/test/core_ext/object_and_class_ext_test.rb @@ -77,7 +77,7 @@ class ObjectInstanceVariableTest < Test::Unit::TestCase def test_copy_instance_variables_from_without_explicit_excludes assert_equal [], @dest.instance_variables @dest.copy_instance_variables_from(@source) - + assert_equal %w(@bar @baz), @dest.instance_variables.sort %w(@bar @baz).each do |name| assert_equal @source.instance_variable_get(name).object_id, @@ -87,7 +87,7 @@ class ObjectInstanceVariableTest < Test::Unit::TestCase def test_copy_instance_variables_from_with_explicit_excludes @dest.copy_instance_variables_from(@source, ['@baz']) - assert_nil @dest.instance_variable_get('@baz') + assert !@dest.instance_variables.include?('@baz') assert_equal 'bar', @dest.instance_variable_get('@bar') end @@ -100,8 +100,8 @@ class ObjectInstanceVariableTest < Test::Unit::TestCase end @dest.copy_instance_variables_from(@source) - assert_nil @dest.instance_variable_get('@bar') - assert_nil @dest.instance_variable_get('@quux') + assert !@dest.instance_variables.include?('@bar') + assert !@dest.instance_variables.include?('@quux') assert_equal 'baz', @dest.instance_variable_get('@baz') end -end \ No newline at end of file +end -- cgit v1.2.3