diff options
Diffstat (limited to 'activesupport')
-rw-r--r-- | activesupport/lib/active_support/core_ext/class/removal.rb | 7 | ||||
-rw-r--r-- | activesupport/test/core_ext/class_test.rb | 10 |
2 files changed, 0 insertions, 17 deletions
diff --git a/activesupport/lib/active_support/core_ext/class/removal.rb b/activesupport/lib/active_support/core_ext/class/removal.rb index 652be4ed78..82163eeb30 100644 --- a/activesupport/lib/active_support/core_ext/class/removal.rb +++ b/activesupport/lib/active_support/core_ext/class/removal.rb @@ -16,13 +16,6 @@ class Class #:nodoc: Object.remove_subclasses_of(self) end - # Returns an array with the names of the subclasses of +self+ as strings. - # - # Integer.subclasses # => ["Bignum", "Fixnum"] - def subclasses - Object.subclasses_of(self).map { |o| o.to_s } - end - # Removes the classes in +klasses+ from their parent module. # # Ordinary classes belong to some module via a constant. This method computes diff --git a/activesupport/test/core_ext/class_test.rb b/activesupport/test/core_ext/class_test.rb index bb4eb3c7d5..58b745a8b2 100644 --- a/activesupport/test/core_ext/class_test.rb +++ b/activesupport/test/core_ext/class_test.rb @@ -34,14 +34,4 @@ class ClassTest < Test::Unit::TestCase Class.remove_class(Y::Z::C) assert_raise(NameError) { Y::Z::C.is_a?(Class) } end - - def test_retrieving_subclasses - @parent = eval("class D; end; D") - @sub = eval("class E < D; end; E") - @subofsub = eval("class F < E; end; F") - assert_equal 2, @parent.subclasses.size - assert_equal [@subofsub.to_s], @sub.subclasses - assert_equal [], @subofsub.subclasses - assert_equal [@sub.to_s, @subofsub.to_s].sort, @parent.subclasses.sort - end end |