mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
Since require_dependency cannot be cleared, remove the dependencies
This commit is contained in:
parent
a3eaaf6b50
commit
77f630d317
1 changed files with 5 additions and 0 deletions
|
@ -42,12 +42,17 @@ class DependenciesTest < Test::Unit::TestCase
|
|||
require_dependency 'dependencies/service_one'
|
||||
require_dependency 'dependencies/service_two'
|
||||
assert_equal 2, ActiveSupport::Dependencies.loaded.size
|
||||
ensure
|
||||
Object.send(:remove_const, :ServiceOne) if Object.const_defined?(:ServiceOne)
|
||||
Object.send(:remove_const, :ServiceTwo) if Object.const_defined?(:ServiceTwo)
|
||||
end
|
||||
|
||||
def test_tracking_identical_loaded_files
|
||||
require_dependency 'dependencies/service_one'
|
||||
require_dependency 'dependencies/service_one'
|
||||
assert_equal 1, ActiveSupport::Dependencies.loaded.size
|
||||
ensure
|
||||
Object.send(:remove_const, :ServiceOne) if Object.const_defined?(:ServiceOne)
|
||||
end
|
||||
|
||||
def test_missing_dependency_raises_missing_source_file
|
||||
|
|
Loading…
Reference in a new issue