aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/test/dependencies_test.rb
diff options
context:
space:
mode:
authorYehuda Katz <yehudakatz@YK.local>2010-02-10 15:06:42 -0800
committerYehuda Katz <yehudakatz@YK.local>2010-02-10 15:06:42 -0800
commit77f630d3171d8c0d6b89321276bfed2adf46f4c4 (patch)
tree2f3da83edf58263bc4e7c2b43adf2ec6cc086f3e /activesupport/test/dependencies_test.rb
parenta3eaaf6b50b76a51080ec9ae6b217095868f3054 (diff)
downloadrails-77f630d3171d8c0d6b89321276bfed2adf46f4c4.tar.gz
rails-77f630d3171d8c0d6b89321276bfed2adf46f4c4.tar.bz2
rails-77f630d3171d8c0d6b89321276bfed2adf46f4c4.zip
Since require_dependency cannot be cleared, remove the dependencies
Diffstat (limited to 'activesupport/test/dependencies_test.rb')
-rw-r--r--activesupport/test/dependencies_test.rb5
1 files changed, 5 insertions, 0 deletions
diff --git a/activesupport/test/dependencies_test.rb b/activesupport/test/dependencies_test.rb
index f782313411..849f68c145 100644
--- a/activesupport/test/dependencies_test.rb
+++ b/activesupport/test/dependencies_test.rb
@@ -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