mirror of
https://github.com/Homebrew/brew.git
synced 2025-07-14 16:09:03 +08:00
Document Assertions
.
This commit is contained in:
parent
e2b784bb98
commit
3e60cb0d8c
@ -1,6 +1,9 @@
|
|||||||
# frozen_string_literal: true
|
# frozen_string_literal: true
|
||||||
|
|
||||||
module Homebrew
|
module Homebrew
|
||||||
|
# Helper functions available in formula `test` blocks.
|
||||||
|
#
|
||||||
|
# @api private
|
||||||
module Assertions
|
module Assertions
|
||||||
include Context
|
include Context
|
||||||
|
|
||||||
@ -8,6 +11,7 @@ module Homebrew
|
|||||||
include ::Test::Unit::Assertions
|
include ::Test::Unit::Assertions
|
||||||
|
|
||||||
# Returns the output of running cmd, and asserts the exit status
|
# Returns the output of running cmd, and asserts the exit status
|
||||||
|
# @api public
|
||||||
def shell_output(cmd, result = 0)
|
def shell_output(cmd, result = 0)
|
||||||
ohai cmd
|
ohai cmd
|
||||||
output = `#{cmd}`
|
output = `#{cmd}`
|
||||||
@ -19,7 +23,8 @@ module Homebrew
|
|||||||
end
|
end
|
||||||
|
|
||||||
# Returns the output of running the cmd with the optional input, and
|
# 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)
|
def pipe_output(cmd, input = nil, result = nil)
|
||||||
ohai cmd
|
ohai cmd
|
||||||
output = IO.popen(cmd, "w+") do |pipe|
|
output = IO.popen(cmd, "w+") do |pipe|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user