Permalink
Browse files

Merge pull request #8491 from igagnidz/master

Issue #8442
  • Loading branch information...
2 parents 6ae3a4e + c712b08 commit 6ed5d515cf945c626fd27b68353d0d6402e37050 @rafaelfranca rafaelfranca committed Oct 24, 2013
Showing with 10 additions and 0 deletions.
  1. +10 −0 activesupport/test/descendants_tracker_without_autoloading_test.rb
@@ -4,4 +4,14 @@
class DescendantsTrackerWithoutAutoloadingTest < ActiveSupport::TestCase
include DescendantsTrackerTestCases
+
+ def test_clear_without_autoloaded_singleton_parent
+ mark_as_autoloaded do
+ parent_instance = Parent.new
+ parent_instance.singleton_class.descendants #adds singleton class in @@direct_descendants
+ ActiveSupport::DescendantsTracker.clear #clear is supposed to remove singleton class keys so GC can remove them.
+ assert !ActiveSupport::DescendantsTracker.class_variable_get(:@@direct_descendants).keys.include?(parent_instance.singleton_class)
+ end
+ end
+
end

0 comments on commit 6ed5d51

Please sign in to comment.