summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--spec/bundler/support/helpers.rb9
1 files changed, 8 insertions, 1 deletions
diff --git a/spec/bundler/support/helpers.rb b/spec/bundler/support/helpers.rb
index ef52e88eed..145008ab42 100644
--- a/spec/bundler/support/helpers.rb
+++ b/spec/bundler/support/helpers.rb
@@ -186,7 +186,10 @@ module Spec
env = options[:env] || {}
env["RUBYOPT"] = opt_add(opt_add("-r#{spec_dir}/support/hax.rb", env["RUBYOPT"]), ENV["RUBYOPT"])
options[:env] = env
- sys_exec("#{Path.gem_bin} #{command}", options)
+ output = sys_exec("#{Path.gem_bin} #{command}", options)
+ stderr = last_command.stderr
+ raise stderr if stderr.include?("WARNING") && !allowed_rubygems_warning?(stderr)
+ output
end
def rake
@@ -542,6 +545,10 @@ module Spec
private
+ def allowed_rubygems_warning?(text)
+ text.include?("open-ended") || text.include?("is a symlink") || text.include?("rake based") || text.include?("expected RubyGems version")
+ end
+
def match_source(contents)
match = /source ["']?(?<source>http[^"']+)["']?/.match(contents)
return unless match