grepcidr: add test (#33473)

This commit is contained in:
Mauro Morales 2018-10-30 10:27:21 +01:00 committed by FX Coudert
parent 74231c5dfa
commit 92479a26a3

View file

@ -19,4 +19,16 @@ class Grepcidr < Formula
bin.install "grepcidr"
man1.install "grepcidr.1"
end
test do
(testpath/"access.log").write <<~EOS
127.0.0.1 duck
8.8.8.8 duck
66.249.64.123 goose
192.168.0.1 duck
EOS
output = shell_output("#{bin}/grepcidr 66.249.64.0/19 access.log")
assert_equal "66.249.64.123 goose", output.strip
end
end