diff --git a/Library/Homebrew/formula_assertions.rb b/Library/Homebrew/formula_assertions.rb index ed24d9d1b5..12913f36ef 100644 --- a/Library/Homebrew/formula_assertions.rb +++ b/Library/Homebrew/formula_assertions.rb @@ -26,7 +26,8 @@ module Homebrew # @api public sig { params(cmd: T.any(Pathname, String), result: Integer).returns(String) } def shell_output(cmd, result = 0) - ohai cmd + ohai cmd.to_s + assert_path_exists cmd, "Pathname '#{cmd}' does not exist!" if cmd.is_a?(Pathname) output = `#{cmd}` assert_equal result, $CHILD_STATUS.exitstatus output @@ -41,7 +42,8 @@ module Homebrew # @api public sig { params(cmd: T.any(String, Pathname), input: T.nilable(String), result: T.nilable(Integer)).returns(String) } def pipe_output(cmd, input = nil, result = nil) - ohai cmd + ohai cmd.to_s + assert_path_exists cmd, "Pathname '#{cmd}' does not exist!" if cmd.is_a?(Pathname) output = IO.popen(cmd, "w+") do |pipe| pipe.write(input) unless input.nil? pipe.close_write