diff options
author | Bundlerbot <bot@bundler.io> | 2019-11-12 14:04:06 +0000 |
---|---|---|
committer | Bundlerbot <bot@bundler.io> | 2019-11-12 14:04:06 +0000 |
commit | 4244534ee9acb6e345fb9066df568f50419ef8f7 (patch) | |
tree | adb32a0bb250c9f6438e57b8f59cf0d973bcdec8 | |
parent | fb17e293c627ae15c9b6afd43bc7cf9754689917 (diff) | |
parent | dd5580844b624db78ec4d2edd8c6b79fa2e2f060 (diff) | |
download | bundler-4244534ee9acb6e345fb9066df568f50419ef8f7.tar.gz |
Merge #7422
7422: Turn on warning mode for specs r=deivid-rodriguez a=deivid-rodriguez
### What was the end-user problem that led to this PR?
The problem was that we're missing verbose warnings like the one fixed by #7417.
### What was your diagnosis of the problem?
My diagnosis was that our specs should let us know about this.
### What is your fix for the problem, implemented in this PR?
My fix is to enable warnings from our helpers that shell out, and fix the warnings they print. There's also some unrelated changes here that I'll try to split out once I get this green.
### Why did you choose this fix out of the possible options?
I chose this fix because it makes it so that our specs help us catching these warnings earlier.
Co-authored-by: David RodrÃguez <deivid.rodriguez@riseup.net>
-rw-r--r-- | spec/runtime/inline_spec.rb | 5 | ||||
-rw-r--r-- | spec/runtime/setup_spec.rb | 2 | ||||
-rw-r--r-- | spec/support/helpers.rb | 2 |
3 files changed, 5 insertions, 4 deletions
diff --git a/spec/runtime/inline_spec.rb b/spec/runtime/inline_spec.rb index 06be2ef83d..afb9c3d180 100644 --- a/spec/runtime/inline_spec.rb +++ b/spec/runtime/inline_spec.rb @@ -5,7 +5,7 @@ RSpec.describe "bundler/inline#gemfile" do requires = ["#{lib_dir}/bundler/inline"] requires.unshift "#{spec_dir}/support/artifice/" + options.delete(:artifice) if options.key?(:artifice) requires = requires.map {|r| "require '#{r}'" }.join("\n") - @out = ruby("#{requires}\n\n" + code, options) + ruby("#{requires}\n\n" + code, options) end before :each do @@ -88,9 +88,8 @@ RSpec.describe "bundler/inline#gemfile" do RUBY expect(out).to include("Installing activesupport") - err.gsub! %r{(.*lib/sinatra/base\.rb:\d+: warning: constant ::Fixnum is deprecated$)}, "" err_lines = err.split("\n") - err_lines.reject!{|line| line =~ /\.rb:\d+: warning: / } + err_lines.reject!{|line| line =~ /\.rb:\d+: warning: / } unless RUBY_VERSION < "2.7" expect(err_lines).to be_empty expect(exitstatus).to be_zero if exitstatus end diff --git a/spec/runtime/setup_spec.rb b/spec/runtime/setup_spec.rb index 4a754945b7..d86d1320ea 100644 --- a/spec/runtime/setup_spec.rb +++ b/spec/runtime/setup_spec.rb @@ -1027,6 +1027,8 @@ end ruby <<-RUBY require '#{lib_dir}/bundler' + bundler_module = class << Bundler; self; end + bundler_module.send(:remove_method, :require) def Bundler.require(path) raise "LOSE" end diff --git a/spec/support/helpers.rb b/spec/support/helpers.rb index 911f734d8b..d085b769d7 100644 --- a/spec/support/helpers.rb +++ b/spec/support/helpers.rb @@ -174,7 +174,7 @@ module Spec env = options.delete(:env) || {} ruby = ruby.gsub(/["`\$]/) {|m| "\\#{m}" } lib_option = options[:no_lib] ? "" : " -I#{lib_dir}" - sys_exec(%(#{Gem.ruby}#{lib_option} -e "#{ruby}"), env) + sys_exec(%(#{Gem.ruby}#{lib_option} -w -e "#{ruby}"), env) end bang :ruby |