mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
Remove descendants warning while executing tests.
This commit is contained in:
parent
033e0a041f
commit
d430db9fd4
2 changed files with 5 additions and 2 deletions
|
@ -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
|
Loading…
Reference in a new issue