homebrew-core/Formula/ack.rb
Mike Naberezny 5683859745 ack: improve test by performing a search
Closes Homebrew/homebrew#26500.

Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
2014-02-07 22:57:54 +00:00

22 lines
529 B
Ruby

require 'formula'
class Ack < Formula
homepage 'http://beyondgrep.com/'
url 'http://beyondgrep.com/ack-2.12-single-file'
sha1 '667b5f2dd83143848a5bfa47f7ba848cbe556e93'
version '2.12'
def install
bin.install "ack-2.12-single-file" => "ack"
system "pod2man", "#{bin}/ack", "ack.1"
man1.install "ack.1"
end
test do
IO.popen("#{bin}/ack --noenv --nocolor bar -", "w+") do |pipe|
pipe.write "foo\nfoo bar\nbaz"
pipe.close_write
assert_equal "foo bar\n", pipe.read
end
end
end