diff options
author | Jeremy Kemper <jeremy@bitsweat.net> | 2007-09-23 01:09:20 +0000 |
---|---|---|
committer | Jeremy Kemper <jeremy@bitsweat.net> | 2007-09-23 01:09:20 +0000 |
commit | ea456801182195b113e695ec9019757ce523be0f (patch) | |
tree | a574d6a90bca45442a348b2f7efc993e538fe118 /activesupport/test/core_ext | |
parent | 2d02199e1581db8dc84361803950b1697f493fc0 (diff) | |
download | rails-ea456801182195b113e695ec9019757ce523be0f.tar.gz rails-ea456801182195b113e695ec9019757ce523be0f.tar.bz2 rails-ea456801182195b113e695ec9019757ce523be0f.zip |
Object.subclasses_of includes anonymous subclasses.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7590 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, 8 insertions, 1 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 1fbb853bc9..a23da097e9 100644 --- a/activesupport/test/core_ext/object_and_class_ext_test.rb +++ b/activesupport/test/core_ext/object_and_class_ext_test.rb @@ -97,7 +97,14 @@ class ClassExtTest < Test::Unit::TestCase classes = Object.subclasses_of(ClassI, ClassK) assert_equal %w(ClassJ Nested::ClassL), classes.collect(&:to_s).sort end - + + def test_subclasses_of_doesnt_find_anonymous_classes + assert_equal [], Object.subclasses_of(Foo) + bar = Class.new(Foo) + assert_nothing_raised do + assert_equal [bar], Object.subclasses_of(Foo) + end + end end class ObjectTests < Test::Unit::TestCase |