mirror of
https://github.com/github/rails.git
synced 2026-04-26 03:00:59 -04:00
Remove descendants warning while executing tests.
This commit is contained in:
@@ -4,9 +4,12 @@ module ActiveSupport
|
||||
# This module provides an internal implementation to track descendants
|
||||
# which is faster than iterating through ObjectSpace.
|
||||
module DescendantsTracker
|
||||
mattr_accessor :descendants
|
||||
@@descendants = Hash.new { |h, k| h[k] = [] }
|
||||
|
||||
def self.descendants
|
||||
@@descendants
|
||||
end
|
||||
|
||||
def self.clear
|
||||
@@descendants.each do |klass, descendants|
|
||||
if ActiveSupport::Dependencies.autoloaded?(klass)
|
||||
|
||||
@@ -70,6 +70,6 @@ class DescendantsTrackerTest < Test::Unit::TestCase
|
||||
yield
|
||||
ensure
|
||||
ActiveSupport::Dependencies.autoloaded_constants = old_autoloaded
|
||||
ActiveSupport::DescendantsTracker.descendants = old_descendants
|
||||
ActiveSupport::DescendantsTracker.descendants.replace(old_descendants)
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user