Permalink
Browse files

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
  • Loading branch information...
jeremy committed Nov 21, 2005
1 parent 5129de7 commit d7924273014a183e86538f33f0f52ceade10cd46
Showing with 5 additions and 5 deletions.
  1. +5 −5 activesupport/test/core_ext/object_and_class_ext_test.rb
@@ -77,7 +77,7 @@ def setup
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 @@ def test_copy_instance_variables_from_without_explicit_excludes
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 @@ def protected_instance_variables
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
+end

0 comments on commit d792427

Please sign in to comment.