From 0c216bc5b827eb0e8bae749ee14aefa43979cce5 Mon Sep 17 00:00:00 2001 From: Mike McQuaid Date: Thu, 24 May 2018 14:28:20 +0100 Subject: [PATCH 1/4] spec_helper: don't truncate output expectations. It's really useful to be able to see the full output particularly when a backtrace is in it. --- Library/Homebrew/test/spec_helper.rb | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Library/Homebrew/test/spec_helper.rb b/Library/Homebrew/test/spec_helper.rb index 2ad3b2e642..1c7c0fcdcd 100644 --- a/Library/Homebrew/test/spec_helper.rb +++ b/Library/Homebrew/test/spec_helper.rb @@ -43,6 +43,10 @@ RSpec.configure do |config| config.filter_run_when_matching :focus + config.expect_with :rspec do |c| + c.max_formatted_output_length = nil + end + config.include(FileUtils) config.include(RuboCop::RSpec::ExpectOffense) From 4c365ea35318b644d76ebbd3d09111dfdaec3da4 Mon Sep 17 00:00:00 2001 From: Mike McQuaid Date: Thu, 24 May 2018 14:28:20 +0100 Subject: [PATCH 2/4] spec_helper: don't truncate output expectations. It's really useful to be able to see the full output particularly when a backtrace is in it. --- Library/Homebrew/test/spec_helper.rb | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/Library/Homebrew/test/spec_helper.rb b/Library/Homebrew/test/spec_helper.rb index 1c7c0fcdcd..97195fe819 100644 --- a/Library/Homebrew/test/spec_helper.rb +++ b/Library/Homebrew/test/spec_helper.rb @@ -43,9 +43,14 @@ RSpec.configure do |config| config.filter_run_when_matching :focus - config.expect_with :rspec do |c| - c.max_formatted_output_length = nil - end + # TODO when https://github.com/rspec/rspec-expectations/pull/1056 makes + # it into a stable release: + # config.expect_with :rspec do |c| + # c.max_formatted_output_length = 200 + # end + + # Never truncate output objects. + RSpec::Support::ObjectFormatter.default_instance.max_formatted_output_length = nil config.include(FileUtils) From 63aacd71d3dc3e578c64137c17b22c2cd62ccc27 Mon Sep 17 00:00:00 2001 From: Mike McQuaid Date: Thu, 24 May 2018 14:51:28 +0100 Subject: [PATCH 3/4] linkage_checker: fix bad instance variable usage. --- Library/Homebrew/linkage_checker.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Library/Homebrew/linkage_checker.rb b/Library/Homebrew/linkage_checker.rb index 559e1d7fa3..0d74a7e678 100644 --- a/Library/Homebrew/linkage_checker.rb +++ b/Library/Homebrew/linkage_checker.rb @@ -40,13 +40,13 @@ class LinkageChecker end def display_test_output(puts_output: true) - display_items "Missing libraries", @broken_dylibs, puts_output: puts_output - display_items "Broken dependencies", @broken_deps, puts_output: puts_output + display_items "Missing libraries", broken_dylibs, puts_output: puts_output + display_items "Broken dependencies", broken_deps, puts_output: puts_output puts "No broken library linkage" unless broken_library_linkage? end def broken_library_linkage? - !@broken_dylibs.empty? || !@broken_deps.empty? + !broken_dylibs.empty? || !broken_deps.empty? end def undeclared_deps From 0408b78a23092fb345bee7af3dcac7c62c175848 Mon Sep 17 00:00:00 2001 From: Mike McQuaid Date: Thu, 24 May 2018 15:09:41 +0100 Subject: [PATCH 4/4] tests: remove linkage cache env. Otherwise this will mess with `brew tests`. --- Library/Homebrew/dev-cmd/tests.rb | 1 + Library/Homebrew/test/spec_helper.rb | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/Library/Homebrew/dev-cmd/tests.rb b/Library/Homebrew/dev-cmd/tests.rb index 3edc12ed5b..c544b36104 100644 --- a/Library/Homebrew/dev-cmd/tests.rb +++ b/Library/Homebrew/dev-cmd/tests.rb @@ -38,6 +38,7 @@ module Homebrew ENV.delete("VERBOSE") ENV.delete("HOMEBREW_CASK_OPTS") ENV.delete("HOMEBREW_TEMP") + ENV.delete("HOMEBREW_LINKAGE_CACHE") ENV["HOMEBREW_NO_ANALYTICS_THIS_RUN"] = "1" ENV["HOMEBREW_DEVELOPER"] = "1" ENV["HOMEBREW_NO_COMPAT"] = "1" if args.no_compat? diff --git a/Library/Homebrew/test/spec_helper.rb b/Library/Homebrew/test/spec_helper.rb index 97195fe819..eef774b48f 100644 --- a/Library/Homebrew/test/spec_helper.rb +++ b/Library/Homebrew/test/spec_helper.rb @@ -43,8 +43,8 @@ RSpec.configure do |config| config.filter_run_when_matching :focus - # TODO when https://github.com/rspec/rspec-expectations/pull/1056 makes - # it into a stable release: + # TODO: when https://github.com/rspec/rspec-expectations/pull/1056 + # makes it into a stable release: # config.expect_with :rspec do |c| # c.max_formatted_output_length = 200 # end