diff options
Diffstat (limited to 'activesupport/test')
-rw-r--r-- | activesupport/test/core_ext/object_and_class_ext_test.rb | 21 |
1 files changed, 21 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 new file mode 100644 index 0000000000..5a0ae58837 --- /dev/null +++ b/activesupport/test/core_ext/object_and_class_ext_test.rb @@ -0,0 +1,21 @@ +require 'test/unit' +require File.dirname(__FILE__) + '/../../lib/core_ext/object_and_class' + +class A; end +class B < A; end +class C < B; end +class D < A; end + +class ClassExtTest < Test::Unit::TestCase + def test_methods + assert defined?(B) + assert defined?(C) + assert defined?(D) + + A.remove_subclasses + + assert !defined?(B) + assert !defined?(C) + assert !defined?(D) + end +end |