diff options
author | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2013-10-24 20:11:50 -0200 |
---|---|---|
committer | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2013-10-24 20:11:50 -0200 |
commit | 6ed5d515cf945c626fd27b68353d0d6402e37050 (patch) | |
tree | 3f209d1d5adbbd1f405a86c0bd6818a416fb2709 /activesupport | |
parent | 6ae3a4e535cd73135cecb8c13375f131fe4ff6f5 (diff) | |
parent | c712b082c54157e31e4f959f110c8ede11315b55 (diff) | |
download | rails-6ed5d515cf945c626fd27b68353d0d6402e37050.tar.gz rails-6ed5d515cf945c626fd27b68353d0d6402e37050.tar.bz2 rails-6ed5d515cf945c626fd27b68353d0d6402e37050.zip |
Merge pull request #8491 from igagnidz/master
Issue #8442
Diffstat (limited to 'activesupport')
-rw-r--r-- | activesupport/test/descendants_tracker_without_autoloading_test.rb | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/activesupport/test/descendants_tracker_without_autoloading_test.rb b/activesupport/test/descendants_tracker_without_autoloading_test.rb index 74669aaca1..4f1ee3e760 100644 --- a/activesupport/test/descendants_tracker_without_autoloading_test.rb +++ b/activesupport/test/descendants_tracker_without_autoloading_test.rb @@ -4,4 +4,14 @@ require 'descendants_tracker_test_cases' 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 |