Skip to content
This repository has been archived by the owner on Apr 14, 2021. It is now read-only.

Commit

Permalink
Merge #7422
Browse files Browse the repository at this point in the history
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>
(cherry picked from commit 4244534)
  • Loading branch information
bundlerbot authored and deivid-rodriguez committed Dec 13, 2019
1 parent 715757e commit daff1cc
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
5 changes: 2 additions & 3 deletions spec/runtime/inline_spec.rb
Expand Up @@ -5,7 +5,7 @@ def script(code, options = {})
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
Expand Down Expand Up @@ -88,9 +88,8 @@ def script(code, options = {})
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
Expand Down
2 changes: 2 additions & 0 deletions spec/runtime/setup_spec.rb
Expand Up @@ -1027,6 +1027,8 @@ def clean_load_path(lp)

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
Expand Down
2 changes: 1 addition & 1 deletion spec/support/helpers.rb
Expand Up @@ -174,7 +174,7 @@ def ruby(ruby, options = {})
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

Expand Down

0 comments on commit daff1cc

Please sign in to comment.