summaryrefslogtreecommitdiff
path: root/spec/support/hax.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/support/hax.rb')
-rw-r--r--spec/support/hax.rb13
1 files changed, 13 insertions, 0 deletions
diff --git a/spec/support/hax.rb b/spec/support/hax.rb
index a3fe041c82..aee55a0ac9 100644
--- a/spec/support/hax.rb
+++ b/spec/support/hax.rb
@@ -3,6 +3,11 @@
require "rubygems"
module Gem
+ if version = ENV["BUNDLER_SPEC_RUBYGEMS_VERSION"]
+ remove_const(:VERSION) if const_defined?(:VERSION)
+ VERSION = version
+ end
+
class Platform
@local = new(ENV["BUNDLER_SPEC_PLATFORM"]) if ENV["BUNDLER_SPEC_PLATFORM"]
end
@@ -46,3 +51,11 @@ class Object
end
end
end
+
+if ENV["BUNDLER_SPEC_IGNORE_COMPATIBILITY_GUARD"]
+ $LOADED_FEATURES << File.expand_path("../../../bundler/compatibility_guard.rb", __FILE__)
+ $LOADED_FEATURES << File.expand_path("../../../bundler/compatibility_guard", __FILE__)
+ $LOADED_FEATURES << "bundler/compatibility_guard.rb"
+ $LOADED_FEATURES << "bundler/compatibility_guard"
+ require "bundler/compatibility_guard"
+end