Skip to content
Browse files

Fix failing dependencies test relying on . being in LOAD_PATH

  • Loading branch information...
1 parent f503a48 commit ff0377dea594bd24101658c3aceb45b1b9392bfb @jeremy jeremy committed Aug 9, 2009
Showing with 4 additions and 2 deletions.
  1. +4 −2 activesupport/test/dependencies_test.rb
View
6 activesupport/test/dependencies_test.rb
@@ -20,9 +20,11 @@ def teardown
def with_loading(*from)
old_mechanism, ActiveSupport::Dependencies.mechanism = ActiveSupport::Dependencies.mechanism, :load
- dir = File.dirname(__FILE__)
+ this_dir = File.dirname(__FILE__)
+ parent_dir = File.dirname(this_dir)
+ $LOAD_PATH.unshift(parent_dir) unless $LOAD_PATH.include?(parent_dir)
prior_load_paths = ActiveSupport::Dependencies.load_paths
- ActiveSupport::Dependencies.load_paths = from.collect { |f| "#{dir}/#{f}" }
+ ActiveSupport::Dependencies.load_paths = from.collect { |f| "#{this_dir}/#{f}" }
yield
ensure
ActiveSupport::Dependencies.load_paths = prior_load_paths

0 comments on commit ff0377d

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