Skip to content

Commit

Permalink
Fix failing dependencies test relying on . being in LOAD_PATH
Browse files Browse the repository at this point in the history
  • Loading branch information
jeremy committed Sep 13, 2009
1 parent f503a48 commit ff0377d
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions activesupport/test/dependencies_test.rb
Expand Up @@ -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
Expand Down

0 comments on commit ff0377d

Please sign in to comment.