diff options
author | Jeremy Kemper <jeremy@bitsweat.net> | 2007-09-27 09:26:46 +0000 |
---|---|---|
committer | Jeremy Kemper <jeremy@bitsweat.net> | 2007-09-27 09:26:46 +0000 |
commit | d96e38be9992e0fe93668ab46d9442f702d370dd (patch) | |
tree | 0ae2dc949e6488b01c5bdd6ab6f01858210859c4 /activesupport/test | |
parent | 7974f4752b9b4e2bc59f8e611737ff59889867b4 (diff) | |
download | rails-d96e38be9992e0fe93668ab46d9442f702d370dd.tar.gz rails-d96e38be9992e0fe93668ab46d9442f702d370dd.tar.bz2 rails-d96e38be9992e0fe93668ab46d9442f702d370dd.zip |
Backport Object#instance_variable_defined? for Ruby < 1.8.6.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7649 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'activesupport/test')
-rw-r--r-- | activesupport/test/core_ext/object_and_class_ext_test.rb | 7 |
1 files changed, 7 insertions, 0 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 f7e2cc4056..5e6144d64c 100644 --- a/activesupport/test/core_ext/object_and_class_ext_test.rb +++ b/activesupport/test/core_ext/object_and_class_ext_test.rb @@ -177,6 +177,13 @@ class ObjectInstanceVariableTest < Test::Unit::TestCase @source.instance_variable_set(:@baz, 'baz') end + def test_instance_variable_defined + assert @source.instance_variable_defined?('@bar') + assert @source.instance_variable_defined?(:@bar) + assert !@source.instance_variable_defined?(:@foo) + assert !@source.instance_variable_defined?('@foo') + end + def test_copy_instance_variables_from_without_explicit_excludes assert_equal [], @dest.instance_variables @dest.copy_instance_variables_from(@source) |