Skip to content

Commit

Permalink
show cmd being executed
Browse files Browse the repository at this point in the history
  • Loading branch information
adamv committed Aug 1, 2014
1 parent a87e0da commit 1dc8766
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions Library/Homebrew/formula_assertions.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,15 @@ module Assertions

# Returns the output of running cmd, and asserts the exit status
def shell_output(cmd, result=0)
ohai cmd
output = `#{cmd}`
assert_equal result, $?.exitstatus
output
end

# Returns the output of running the cmd, with the optional input
def pipe_output(cmd, input=nil)
ohai cmd
IO.popen(cmd, "w+") do |pipe|
pipe.write(input) unless input.nil?
pipe.close_write
Expand Down

0 comments on commit 1dc8766

Please sign in to comment.