From 3e60cb0d8c99f545197873988f59445a0fd342fb Mon Sep 17 00:00:00 2001 From: Markus Reiter Date: Mon, 17 Aug 2020 05:15:22 +0200 Subject: [PATCH] Document `Assertions`. --- Library/Homebrew/formula_assertions.rb | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) 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|