Skip to content
This repository
Browse code

Since require_dependency cannot be cleared, remove the dependencies

  • Loading branch information...
commit 77f630d3171d8c0d6b89321276bfed2adf46f4c4 1 parent a3eaaf6
authored February 10, 2010

Showing 1 changed file with 5 additions and 0 deletions. Show diff stats Hide diff stats

  1. 5  activesupport/test/dependencies_test.rb
5  activesupport/test/dependencies_test.rb
@@ -42,12 +42,17 @@ def test_tracking_loaded_files
42 42
     require_dependency 'dependencies/service_one'
43 43
     require_dependency 'dependencies/service_two'
44 44
     assert_equal 2, ActiveSupport::Dependencies.loaded.size
  45
+  ensure
  46
+    Object.send(:remove_const, :ServiceOne) if Object.const_defined?(:ServiceOne)
  47
+    Object.send(:remove_const, :ServiceTwo) if Object.const_defined?(:ServiceTwo)
45 48
   end
46 49
 
47 50
   def test_tracking_identical_loaded_files
48 51
     require_dependency 'dependencies/service_one'
49 52
     require_dependency 'dependencies/service_one'
50 53
     assert_equal 1, ActiveSupport::Dependencies.loaded.size
  54
+  ensure
  55
+    Object.send(:remove_const, :ServiceOne) if Object.const_defined?(:ServiceOne)
51 56
   end
52 57
 
53 58
   def test_missing_dependency_raises_missing_source_file

0 notes on commit 77f630d

Please sign in to comment.
Something went wrong with that request. Please try again.