Skip to content
This repository
Browse code

Fixed failing tests.

  • Loading branch information...
commit 17c9efb76fea2ee7cc0a09cadeeae864038c9f72 1 parent f505565
Arun Agrawal authored May 24, 2011
2  activesupport/test/dependencies_test.rb
@@ -24,11 +24,13 @@ def with_loading(*from)
24 24
     old_mechanism, ActiveSupport::Dependencies.mechanism = ActiveSupport::Dependencies.mechanism, :load
25 25
     this_dir = File.dirname(__FILE__)
26 26
     parent_dir = File.dirname(this_dir)
  27
+    path_copy = $LOAD_PATH.dup
27 28
     $LOAD_PATH.unshift(parent_dir) unless $LOAD_PATH.include?(parent_dir)
28 29
     prior_autoload_paths = ActiveSupport::Dependencies.autoload_paths
29 30
     ActiveSupport::Dependencies.autoload_paths = from.collect { |f| "#{this_dir}/#{f}" }
30 31
     yield
31 32
   ensure
  33
+    $LOAD_PATH.replace(path_copy)
32 34
     ActiveSupport::Dependencies.autoload_paths = prior_autoload_paths
33 35
     ActiveSupport::Dependencies.mechanism = old_mechanism
34 36
     ActiveSupport::Dependencies.explicitly_unloadable_constants = []
3  activesupport/test/load_paths_test.rb
@@ -10,6 +10,7 @@ def test_uniq_load_paths
10 10
     }
11 11
     load_paths_count[File.expand_path('../../lib', __FILE__)] -= 1
12 12
 
13  
-    assert load_paths_count.select { |k, v| v > 1 }.empty?, $LOAD_PATH.inspect
  13
+    filtered = load_paths_count.select { |k, v| v > 1 }
  14
+    assert filtered.empty?, filtered.inspect
14 15
   end
15 16
 end

0 notes on commit 17c9efb

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