From f831baf43f93175dcfbcdf2dbc1fd887e64e1459 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20Rodr=C3=ADguez?= Date: Tue, 5 Nov 2019 13:00:05 +0100 Subject: [PATCH 1/5] Enable warnings in ruby subprocesses --- spec/support/helpers.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spec/support/helpers.rb b/spec/support/helpers.rb index 911f734d8b4..d085b769d73 100644 --- a/spec/support/helpers.rb +++ b/spec/support/helpers.rb @@ -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 From 66dc959276d8c9b6d71f097a69c59cc25b5b25f3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20Rodr=C3=ADguez?= Date: Tue, 5 Nov 2019 15:42:40 +0100 Subject: [PATCH 2/5] Remove unused instance variable --- spec/runtime/inline_spec.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spec/runtime/inline_spec.rb b/spec/runtime/inline_spec.rb index 06be2ef83d5..5712ce86cda 100644 --- a/spec/runtime/inline_spec.rb +++ b/spec/runtime/inline_spec.rb @@ -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 From acfa0f980f3952064bfbcbd024b1ed51b6b11f2d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20Rodr=C3=ADguez?= Date: Tue, 5 Nov 2019 15:46:17 +0100 Subject: [PATCH 3/5] Remove already fixed warning --- spec/runtime/inline_spec.rb | 1 - 1 file changed, 1 deletion(-) diff --git a/spec/runtime/inline_spec.rb b/spec/runtime/inline_spec.rb index 5712ce86cda..718b896ecb4 100644 --- a/spec/runtime/inline_spec.rb +++ b/spec/runtime/inline_spec.rb @@ -88,7 +88,6 @@ 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: / } expect(err_lines).to be_empty From be96d7e27fb85d19e2a33ddd52b431c7432e66f9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20Rodr=C3=ADguez?= Date: Tue, 5 Nov 2019 16:37:35 +0100 Subject: [PATCH 4/5] Fix `Bundler.require` redefinition warning --- spec/runtime/setup_spec.rb | 2 ++ 1 file changed, 2 insertions(+) diff --git a/spec/runtime/setup_spec.rb b/spec/runtime/setup_spec.rb index 4a754945b75..d86d1320eab 100644 --- a/spec/runtime/setup_spec.rb +++ b/spec/runtime/setup_spec.rb @@ -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 From dd5580844b624db78ec4d2edd8c6b79fa2e2f060 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20Rodr=C3=ADguez?= Date: Tue, 5 Nov 2019 16:37:52 +0100 Subject: [PATCH 5/5] Don't allow warnings on released rubies --- spec/runtime/inline_spec.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spec/runtime/inline_spec.rb b/spec/runtime/inline_spec.rb index 718b896ecb4..afb9c3d180c 100644 --- a/spec/runtime/inline_spec.rb +++ b/spec/runtime/inline_spec.rb @@ -89,7 +89,7 @@ def script(code, options = {}) expect(out).to include("Installing activesupport") 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