aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/test
diff options
context:
space:
mode:
authorCristian Bica <cristian.bica@gmail.com>2014-08-13 22:55:32 +0300
committerCristian Bica <cristian.bica@gmail.com>2014-08-13 22:55:32 +0300
commit06908e60be2bd3e2f247e26d3d1fa6bcb7f43943 (patch)
tree2f1752c774fad931e62669ee96d26b5b7da0bd61 /activesupport/test
parent95b79c1ff4d253d1554615baa5a02b0910d5a6dc (diff)
parent2750cc41484266c731c4bf0460d74b0de49e7450 (diff)
downloadrails-06908e60be2bd3e2f247e26d3d1fa6bcb7f43943.tar.gz
rails-06908e60be2bd3e2f247e26d3d1fa6bcb7f43943.tar.bz2
rails-06908e60be2bd3e2f247e26d3d1fa6bcb7f43943.zip
Merge branch 'master' into activejob
Diffstat (limited to 'activesupport/test')
-rw-r--r--activesupport/test/dependencies_test.rb23
1 files changed, 10 insertions, 13 deletions
diff --git a/activesupport/test/dependencies_test.rb b/activesupport/test/dependencies_test.rb
index a013aadd67..5fc3de651a 100644
--- a/activesupport/test/dependencies_test.rb
+++ b/activesupport/test/dependencies_test.rb
@@ -47,18 +47,22 @@ class DependenciesTest < ActiveSupport::TestCase
end
def test_tracking_loaded_files
- require_dependency 'dependencies/service_one'
- require_dependency 'dependencies/service_two'
- assert_equal 2, ActiveSupport::Dependencies.loaded.size
+ with_loading do
+ require_dependency 'dependencies/service_one'
+ require_dependency 'dependencies/service_two'
+ assert_equal 2, ActiveSupport::Dependencies.loaded.size
+ end
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
+ with_loading do
+ require_dependency 'dependencies/service_one'
+ require_dependency 'dependencies/service_one'
+ assert_equal 1, ActiveSupport::Dependencies.loaded.size
+ end
ensure
Object.send(:remove_const, :ServiceOne) if Object.const_defined?(:ServiceOne)
end
@@ -990,11 +994,4 @@ class DependenciesTest < ActiveSupport::TestCase
ensure
ActiveSupport::Dependencies.hook!
end
-
-private
- def remove_constants(*constants)
- constants.each do |constant|
- Object.send(:remove_const, constant) if Object.const_defined?(constant)
- end
- end
end