summaryrefslogtreecommitdiff
path: root/spec/bundler/support/switch_rubygems.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/bundler/support/switch_rubygems.rb')
-rw-r--r--spec/bundler/support/switch_rubygems.rb14
1 files changed, 14 insertions, 0 deletions
diff --git a/spec/bundler/support/switch_rubygems.rb b/spec/bundler/support/switch_rubygems.rb
new file mode 100644
index 0000000000..d3dd685d31
--- /dev/null
+++ b/spec/bundler/support/switch_rubygems.rb
@@ -0,0 +1,14 @@
+# frozen_string_literal: true
+
+require_relative "rubygems_version_manager"
+RubygemsVersionManager.new(ENV["RGV"]).switch
+
+if ENV["BUNDLER_SPEC_IGNORE_DEFAULT_BUNDLER_GEM"]
+ module NoBundlerStubs
+ def default_stubs(pattern = "*.gemspec")
+ super(pattern).reject {|s| s.name == "bundler" }
+ end
+ end
+
+ Gem::Specification.singleton_class.prepend(NoBundlerStubs)
+end