1
0
Fork 0
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:
Yehuda Katz 2010-02-10 15:06:42 -08:00
parent a3eaaf6b50
commit 77f630d317

View file

@ -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