diff --git a/Library/Homebrew/formula_assertions.rb b/Library/Homebrew/formula_assertions.rb index 55592f2214..fdcfa86573 100644 --- a/Library/Homebrew/formula_assertions.rb +++ b/Library/Homebrew/formula_assertions.rb @@ -1,6 +1,9 @@ # frozen_string_literal: true module Homebrew + # Helper functions available in formula `test` blocks. + # + # @api private module Assertions include Context @@ -8,6 +11,7 @@ module Homebrew include ::Test::Unit::Assertions # Returns the output of running cmd, and asserts the exit status + # @api public def shell_output(cmd, result = 0) ohai cmd output = `#{cmd}` @@ -19,7 +23,8 @@ module Homebrew end # Returns the output of running the cmd with the optional input, and - # optionally asserts the exit status + # optionally asserts the exit status. + # @api public def pipe_output(cmd, input = nil, result = nil) ohai cmd output = IO.popen(cmd, "w+") do |pipe|