diff options
Diffstat (limited to 'activesupport/test')
-rw-r--r-- | activesupport/test/abstract_unit.rb | 1 | ||||
-rw-r--r-- | activesupport/test/core_ext/object_and_class_ext_test.rb | 9 |
2 files changed, 9 insertions, 1 deletions
diff --git a/activesupport/test/abstract_unit.rb b/activesupport/test/abstract_unit.rb index fba9ff97b2..791efb549a 100644 --- a/activesupport/test/abstract_unit.rb +++ b/activesupport/test/abstract_unit.rb @@ -6,6 +6,7 @@ require 'active_support' # Wrap tests that use Mocha and skip if unavailable. def uses_mocha(test_name) require 'rubygems' + gem 'mocha', '>= 0.5.5' require 'mocha' yield rescue LoadError 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 |