aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/test/core_ext
diff options
context:
space:
mode:
authorJeremy Kemper <jeremy@bitsweat.net>2005-11-21 07:29:39 +0000
committerJeremy Kemper <jeremy@bitsweat.net>2005-11-21 07:29:39 +0000
commitd7924273014a183e86538f33f0f52ceade10cd46 (patch)
tree65860a6636067144d1b77f7572aaca804f400701 /activesupport/test/core_ext
parent5129de7bbdbd15e47ce5baf7945caf2e78d82882 (diff)
downloadrails-d7924273014a183e86538f33f0f52ceade10cd46.tar.gz
rails-d7924273014a183e86538f33f0f52ceade10cd46.tar.bz2
rails-d7924273014a183e86538f33f0f52ceade10cd46.zip
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
Diffstat (limited to 'activesupport/test/core_ext')
-rw-r--r--activesupport/test/core_ext/object_and_class_ext_test.rb10
1 files changed, 5 insertions, 5 deletions
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