summaryrefslogtreecommitdiff
path: root/test/rubygems/helper.rb
diff options
context:
space:
mode:
Diffstat (limited to 'test/rubygems/helper.rb')
-rw-r--r--test/rubygems/helper.rb8
1 files changed, 6 insertions, 2 deletions
diff --git a/test/rubygems/helper.rb b/test/rubygems/helper.rb
index 6635481a9f..fbdc34e357 100644
--- a/test/rubygems/helper.rb
+++ b/test/rubygems/helper.rb
@@ -544,6 +544,10 @@ class Gem::TestCase < Test::Unit::TestCase
Gem.pre_uninstall_hooks.clear
end
+ def without_any_upwards_gemfiles
+ ENV["BUNDLE_GEMFILE"] = File.join(@tempdir, "Gemfile")
+ end
+
##
# A git_gem is used with a gem dependencies file. The gem created here
# has no files, just a gem specification for the given +name+ and +version+.
@@ -1291,7 +1295,7 @@ Also, a list:
end
def ruby_with_rubygems_in_load_path
- [Gem.ruby, "-I", File.expand_path("../../lib", __dir__)]
+ [Gem.ruby, "-I", $LOAD_PATH.find{|p| p == File.dirname($LOADED_FEATURES.find{|f| f.end_with?("/rubygems.rb") }) }]
end
def with_clean_path_to_ruby
@@ -1591,7 +1595,7 @@ class Object
metaclass.send :undef_method, name
metaclass.send :alias_method, name, new_name
metaclass.send :undef_method, new_name
- end unless method_defined?(:stub) # lib/resolv/test_dns.rb also has the same method definition
+ end
end
require_relative 'utilities'