aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/test
diff options
context:
space:
mode:
authorDavid Heinemeier Hansson <david@loudthinking.com>2005-09-20 11:23:13 +0000
committerDavid Heinemeier Hansson <david@loudthinking.com>2005-09-20 11:23:13 +0000
commit6a519401176126cd808aa5e3562a21f34a64de65 (patch)
tree7da966acceedfb11ceb234d796fa0250033fa6b3 /activesupport/test
parent8a35865b747e0e96ae53e45997d6742f8f0ccfc3 (diff)
downloadrails-6a519401176126cd808aa5e3562a21f34a64de65.tar.gz
rails-6a519401176126cd808aa5e3562a21f34a64de65.tar.bz2
rails-6a519401176126cd808aa5e3562a21f34a64de65.zip
Fixed memory leak with Active Record classes when Dependencies.mechanism = :load #1704 [c.r.mcgrath@gmail.com]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@2276 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'activesupport/test')
-rw-r--r--activesupport/test/core_ext/object_and_class_ext_test.rb46
1 files changed, 0 insertions, 46 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 29b2f2fc8b..29e18d5ae1 100644
--- a/activesupport/test/core_ext/object_and_class_ext_test.rb
+++ b/activesupport/test/core_ext/object_and_class_ext_test.rb
@@ -5,27 +5,6 @@ class ClassA; end
class ClassB < ClassA; end
class ClassC < ClassB; end
class ClassD < ClassA; end
-class RemoveSubsTestClass; end
-class RemoveSubsBaseClass
- def self.add_ivar
- @ivar = RemoveSubsTestClass.new
- end
-end
-class RemoveSubsSubClass < RemoveSubsBaseClass; end
-class RemoveSubsTestClass2; end
-class RemoveSubsBaseClass2
- def self.add_ivar
- @ivar = RemoveSubsTestClass2.new
- end
-end
-class RemoveSubsSubClass2 < RemoveSubsBaseClass2; end
-class RemoveSubsTestClass3; end
-class RemoveSubsBaseClass3
- def self.add_ivar
- @ivar = RemoveSubsTestClass3.new
- end
-end
-class RemoveSubsSubClass3 < RemoveSubsBaseClass3; end
class ClassExtTest < Test::Unit::TestCase
def test_methods
@@ -51,29 +30,4 @@ class ObjectTests < Test::Unit::TestCase
suppress(LoadError, ArgumentError) { raise LoadError }
suppress(LoadError, ArgumentError) { raise ArgumentError }
end
-
- def test_remove_subclasses_of_unsets_ivars
- r = RemoveSubsSubClass.new
- RemoveSubsSubClass.add_ivar
- RemoveSubsBaseClass.remove_subclasses
-
- GC.start
- ObjectSpace.each_object do |o|
- flunk("ObjectSpace still contains RemoveSubsTestClass") if o.class == RemoveSubsTestClass
- end
- end
-
- def test_remove_subclasses_of_multiple_classes_unsets_ivars
- r2 = RemoveSubsSubClass2.new
- RemoveSubsSubClass2.add_ivar
- r3 = RemoveSubsSubClass3.new
- RemoveSubsSubClass3.add_ivar
-
- Object.remove_subclasses_of(RemoveSubsBaseClass2, RemoveSubsBaseClass3)
-
- GC.start
- ObjectSpace.each_object do |o|
- flunk("ObjectSpace still contains RemoveSubsTestClass") if o.class == RemoveSubsTestClass
- end
- end
end