aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/test/core_ext/object_and_class_ext_test.rb
diff options
context:
space:
mode:
Diffstat (limited to 'activesupport/test/core_ext/object_and_class_ext_test.rb')
-rw-r--r--activesupport/test/core_ext/object_and_class_ext_test.rb9
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