class DescendantsTrackerWithAutoloadingTest

Public Instance Methods

test_clear_with_autoloaded_children_and_grandchildren() click to toggle source
# File activesupport/test/descendants_tracker_with_autoloading_test.rb, line 20
def test_clear_with_autoloaded_children_and_grandchildren
  mark_as_autoloaded Child1, Grandchild1, Grandchild2 do
    ActiveSupport::DescendantsTracker.clear
    assert_equal_sets [Child2], Parent.descendants
    assert_equal_sets [], Child2.descendants
  end
end
test_clear_with_autoloaded_grandchildren() click to toggle source
# File activesupport/test/descendants_tracker_with_autoloading_test.rb, line 28
def test_clear_with_autoloaded_grandchildren
  mark_as_autoloaded Grandchild1, Grandchild2 do
    ActiveSupport::DescendantsTracker.clear
    assert_equal_sets [Child1, Child2], Parent.descendants
    assert_equal_sets [], Child1.descendants
    assert_equal_sets [], Child2.descendants
  end
end
test_clear_with_autoloaded_parent_children_and_grandchildren() click to toggle source
# File activesupport/test/descendants_tracker_with_autoloading_test.rb, line 11
def test_clear_with_autoloaded_parent_children_and_grandchildren
  mark_as_autoloaded(*ALL) do
    ActiveSupport::DescendantsTracker.clear
    ALL.each do |k|
      assert ActiveSupport::DescendantsTracker.descendants(k).empty?
    end
  end
end