summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSamuel Giddins <segiddins@segiddins.me>2017-12-12 19:40:16 -0600
committerSHIBATA Hiroshi <hsbt@ruby-lang.org>2017-12-21 16:48:43 +0900
commit3ae97bafcfab5e7645a7a41642ca923af70a521a (patch)
treebc752a11e064506c362f76fbf385f530c69317c0
parent9b0802e564afb02da84116c783ef7fc06e689792 (diff)
downloadbundler-3ae97bafcfab5e7645a7a41642ca923af70a521a.tar.gz
Fix the pristine spec so it still can access the default gem
-rw-r--r--spec/commands/pristine_spec.rb1
-rw-r--r--spec/support/hax.rb2
2 files changed, 2 insertions, 1 deletions
diff --git a/spec/commands/pristine_spec.rb b/spec/commands/pristine_spec.rb
index 108606e8aa..54eb2c0b20 100644
--- a/spec/commands/pristine_spec.rb
+++ b/spec/commands/pristine_spec.rb
@@ -41,6 +41,7 @@ RSpec.describe "bundle pristine" do
end
it "does not delete the bundler gem" do
+ ENV["BUNDLER_SPEC_KEEP_DEFAULT_BUNDLER_GEM"] = "true"
system_gems :bundler
bundle! "install"
bundle! "pristine", :system_bundler => true
diff --git a/spec/support/hax.rb b/spec/support/hax.rb
index 9ef4420c72..b14e4a5943 100644
--- a/spec/support/hax.rb
+++ b/spec/support/hax.rb
@@ -13,7 +13,7 @@ module Gem
end
@platforms = [Gem::Platform::RUBY, Gem::Platform.local]
- if defined?(@path_to_default_spec_map)
+ if defined?(@path_to_default_spec_map) && !ENV["BUNDLER_SPEC_KEEP_DEFAULT_BUNDLER_GEM"]
@path_to_default_spec_map.delete_if do |_path, spec|
spec.name == "bundler"
end