Skip to content

Commit ff0377d

Browse files
committed
Fix failing dependencies test relying on . being in LOAD_PATH
1 parent f503a48 commit ff0377d

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

activesupport/test/dependencies_test.rb

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,11 @@ def teardown
2020

2121
def with_loading(*from)
2222
old_mechanism, ActiveSupport::Dependencies.mechanism = ActiveSupport::Dependencies.mechanism, :load
23-
dir = File.dirname(__FILE__)
23+
this_dir = File.dirname(__FILE__)
24+
parent_dir = File.dirname(this_dir)
25+
$LOAD_PATH.unshift(parent_dir) unless $LOAD_PATH.include?(parent_dir)
2426
prior_load_paths = ActiveSupport::Dependencies.load_paths
25-
ActiveSupport::Dependencies.load_paths = from.collect { |f| "#{dir}/#{f}" }
27+
ActiveSupport::Dependencies.load_paths = from.collect { |f| "#{this_dir}/#{f}" }
2628
yield
2729
ensure
2830
ActiveSupport::Dependencies.load_paths = prior_load_paths

0 commit comments

Comments
 (0)