mirror of
https://github.com/gosticks/brew.git
synced 2026-08-13 05:00:20 +00:00
Document Assertions.
This commit is contained in:
@@ -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|
|
||||
|
||||
Reference in New Issue
Block a user