From 1d404e437b760386ac9aae2463e74a9c7f6d7229 Mon Sep 17 00:00:00 2001 From: Sam Ford <1584702+samford@users.noreply.github.com> Date: Wed, 16 Aug 2023 12:53:50 -0400 Subject: [PATCH] dev-cmd/livecheck: avoid watchlist in test The existing watchlist test in `dev-cmd/livecheck_spec.rb` will only pass if the testing environment doesn't contain a livecheck watchlist file. When a watchlist file is present, it ends up being treated as empty (formulae and casks aren't available in tests) and produces an `Invalid usage: No formulae or casks to check` error instead. We don't have to worry about a watchlist file on CI but it's a potential issue when running `brew test` locally. This provides a bogus `HOMEBREW_LIVECHECK_WATCHLIST` value to the `#brew` call, to ensure that any watchlist file in the testing environment is not used for this test. Co-authored-by: Mike McQuaid --- Library/Homebrew/test/dev-cmd/livecheck_spec.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Library/Homebrew/test/dev-cmd/livecheck_spec.rb b/Library/Homebrew/test/dev-cmd/livecheck_spec.rb index 2aaad5cd0e..2496fa660b 100644 --- a/Library/Homebrew/test/dev-cmd/livecheck_spec.rb +++ b/Library/Homebrew/test/dev-cmd/livecheck_spec.rb @@ -20,7 +20,7 @@ describe "brew livecheck" do end it "gives an error when no arguments are given and there's no watchlist", :integration_test do - expect { brew "livecheck" } + expect { brew "livecheck", "HOMEBREW_LIVECHECK_WATCHLIST" => ".this_should_not_exist" } .to output(/Invalid usage: A watchlist file is required when no arguments are given\./).to_stderr .and not_to_output.to_stdout .and be_a_failure