summaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
authorKazuhiro NISHIYAMA <zn@mbf.nifty.com>2021-01-28 18:23:13 +0900
committerKazuhiro NISHIYAMA <zn@mbf.nifty.com>2021-01-28 18:23:13 +0900
commit1b377b32c8616f85c0a97e68758c5c2db83f2169 (patch)
treec0d5c045f0c981895024ab2d5ef00829ccfef42c /spec
parent763d242fcdb2cd400a8973d7d0da3e162fee90d6 (diff)
Add fallback when PWD is not set
Diffstat (limited to 'spec')
-rw-r--r--spec/bundler/runtime/setup_spec.rb8
1 files changed, 6 insertions, 2 deletions
diff --git a/spec/bundler/runtime/setup_spec.rb b/spec/bundler/runtime/setup_spec.rb
index 09430d6a8c..e2bed00a7f 100644
--- a/spec/bundler/runtime/setup_spec.rb
+++ b/spec/bundler/runtime/setup_spec.rb
@@ -1340,8 +1340,12 @@ end
# override the default gem.
def load_path_exclusions_hack_for(name)
if ruby_core?
- # .ext/common is relative from build directory
- ext_folder = Pathname(ENV["PWD"]) + ".ext/common"
+ if ENV.key?("PWD")
+ # .ext/common is relative from build directory
+ ext_folder = Pathname(ENV["PWD"]) + ".ext/common"
+ else
+ ext_folder = source_root.join(".ext/common")
+ end
require_name = name.tr("-", "/")
if File.exist?(ext_folder.join("#{require_name}.rb"))
{ :exclude_from_load_path => ext_folder.to_s }