Document Assertions.

This commit is contained in:
Markus Reiter 2020-08-17 05:15:22 +02:00
parent e2b784bb98
commit 3e60cb0d8c

View File

@ -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|