aboutsummaryrefslogtreecommitdiffstats
path: root/lib/rubygems/test_case.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/rubygems/test_case.rb')
-rw-r--r--lib/rubygems/test_case.rb22
1 files changed, 18 insertions, 4 deletions
diff --git a/lib/rubygems/test_case.rb b/lib/rubygems/test_case.rb
index a8261ef5c2..83a3c446a7 100644
--- a/lib/rubygems/test_case.rb
+++ b/lib/rubygems/test_case.rb
@@ -26,7 +26,20 @@ begin
rescue LoadError
end
-require 'bundler'
+if File.exist?(bundler_gemspec)
+ require_relative '../../bundler/lib/bundler'
+else
+ require 'bundler'
+end
+
+# Enable server plugin needed for bisection
+if ENV["RG_BISECT_SERVER_PLUGIN"]
+ require ENV["RG_BISECT_SERVER_PLUGIN"]
+
+ Minitest.extensions << "server"
+end
+
+ENV["MT_NO_PLUGINS"] = "true"
require 'minitest/autorun'
@@ -250,16 +263,16 @@ class Gem::TestCase < Minitest::Test
def assert_contains_make_command(target, output, msg = nil)
if output.match(/\n/)
msg = message(msg) do
- 'Expected output containing make command "%s": %s' % [
+ "Expected output containing make command \"%s\", but was \n\nBEGIN_OF_OUTPUT\n%sEND_OF_OUTPUT" % [
('%s %s' % [make_command, target]).rstrip,
- output.inspect,
+ output,
]
end
else
msg = message(msg) do
'Expected make command "%s": %s' % [
('%s %s' % [make_command, target]).rstrip,
- output.inspect,
+ output,
]
end
end
@@ -298,6 +311,7 @@ class Gem::TestCase < Minitest::Test
ENV['XDG_CONFIG_HOME'] = nil
ENV['XDG_DATA_HOME'] = nil
ENV['SOURCE_DATE_EPOCH'] = nil
+ ENV['BUNDLER_VERSION'] = nil
ENV["TMPDIR"] = @tmp
@current_dir = Dir.pwd