From ecdd45e73e503a46319d1c5b70f4a342a15fe6d8 Mon Sep 17 00:00:00 2001 From: Issy Long Date: Fri, 12 Jul 2024 16:28:35 -0400 Subject: [PATCH] formula_assertions: Fix type of `cmd` param in `shell_output` - This can be either a String or a Pathname, per the part of the `noseyparker` test that failed (in a different part of the test, the command is passed as a string). ``` ==> Testing noseyparker ==> /opt/homebrew/Cellar/noseyparker/0.18.1/bin/noseyparker -V Error: noseyparker: failed An exception occurred within a child process: TypeError: Parameter 'cmd': Expected type String, got type Pathname with value # Caller: /opt/homebrew/Library/Taps/homebrew/homebrew-core/Formula/n/noseyparker.rb:35 ``` --- Library/Homebrew/formula_assertions.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Library/Homebrew/formula_assertions.rb b/Library/Homebrew/formula_assertions.rb index db3320b62a..a1741f6658 100644 --- a/Library/Homebrew/formula_assertions.rb +++ b/Library/Homebrew/formula_assertions.rb @@ -21,7 +21,7 @@ module Homebrew # Returns the output of running cmd and asserts the exit status. # # @api public - sig { params(cmd: String, result: Integer).returns(String) } + sig { params(cmd: T.any(Pathname, String), result: Integer).returns(String) } def shell_output(cmd, result = 0) ohai cmd output = `#{cmd}`