We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent f503a48 commit ff0377dCopy full SHA for ff0377d
activesupport/test/dependencies_test.rb
@@ -20,9 +20,11 @@ def teardown
20
21
def with_loading(*from)
22
old_mechanism, ActiveSupport::Dependencies.mechanism = ActiveSupport::Dependencies.mechanism, :load
23
- dir = File.dirname(__FILE__)
+ this_dir = File.dirname(__FILE__)
24
+ parent_dir = File.dirname(this_dir)
25
+ $LOAD_PATH.unshift(parent_dir) unless $LOAD_PATH.include?(parent_dir)
26
prior_load_paths = ActiveSupport::Dependencies.load_paths
- ActiveSupport::Dependencies.load_paths = from.collect { |f| "#{dir}/#{f}" }
27
+ ActiveSupport::Dependencies.load_paths = from.collect { |f| "#{this_dir}/#{f}" }
28
yield
29
ensure
30
ActiveSupport::Dependencies.load_paths = prior_load_paths
0 commit comments