diff options
author | David Heinemeier Hansson <david@loudthinking.com> | 2006-02-19 01:05:55 +0000 |
---|---|---|
committer | David Heinemeier Hansson <david@loudthinking.com> | 2006-02-19 01:05:55 +0000 |
commit | 9723d03531ac73d5e06377f6968710d1473752ae (patch) | |
tree | 949114c8e7795326642d995be905162364544a03 /activesupport/test/core_ext | |
parent | 8896efd41aca929ef91ee28a0e406bffeb253834 (diff) | |
download | rails-9723d03531ac73d5e06377f6968710d1473752ae.tar.gz rails-9723d03531ac73d5e06377f6968710d1473752ae.tar.bz2 rails-9723d03531ac73d5e06377f6968710d1473752ae.zip |
Fix Object.subclasses_of to only return currently defined objects (closes #3882) [Jonathan Viney <jonathan@bluewire.net.nz>]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@3607 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'activesupport/test/core_ext')
-rw-r--r-- | activesupport/test/core_ext/object_and_class_ext_test.rb | 9 |
1 files changed, 9 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 5d7a06d08d..6a100e813b 100644 --- a/activesupport/test/core_ext/object_and_class_ext_test.rb +++ b/activesupport/test/core_ext/object_and_class_ext_test.rb @@ -7,6 +7,9 @@ class ClassB < ClassA; end class ClassC < ClassB; end class ClassD < ClassA; end +class ClassI; end +class ClassJ < ClassI; end + module Bar def bar; end end @@ -31,6 +34,12 @@ class ClassExtTest < Test::Unit::TestCase assert !defined?(ClassC) assert !defined?(ClassD) end + + def test_subclasses_of + assert_equal [ClassJ], Object.subclasses_of(ClassI) + ClassI.remove_subclasses + assert_equal [], Object.subclasses_of(ClassI) + end end class ObjectTests < Test::Unit::TestCase |