mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
Fix failing dependencies test relying on . being in LOAD_PATH
This commit is contained in:
parent
d0bcf51191
commit
87e2c1895f
1 changed files with 4 additions and 2 deletions
|
@ -24,9 +24,11 @@ class DependenciesTest < Test::Unit::TestCase
|
||||||
|
|
||||||
def with_loading(*from)
|
def with_loading(*from)
|
||||||
old_mechanism, ActiveSupport::Dependencies.mechanism = ActiveSupport::Dependencies.mechanism, :load
|
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
|
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
|
yield
|
||||||
ensure
|
ensure
|
||||||
ActiveSupport::Dependencies.load_paths = prior_load_paths
|
ActiveSupport::Dependencies.load_paths = prior_load_paths
|
||||||
|
|
Loading…
Reference in a new issue