bulk_extractor: add test

Closes Homebrew/homebrew#28362.

Signed-off-by: Adam Vandenberg <flangy@gmail.com>
This commit is contained in:
Mike Naberezny 2014-04-12 17:44:19 -07:00 committed by Adam Vandenberg
parent 48647b72cd
commit 538c949109

View file

@ -34,4 +34,15 @@ class BulkExtractor < Formula
libexec.install 'java_gui/BEViewer.jar'
bin.write_jar_script libexec/"BEViewer.jar", "BEViewer", "-Xmx1g"
end
test do
input_file = testpath/"data.txt"
input_file.write "http://brew.sh\n(201)555-1212\n"
output_dir = testpath/"output"
system "#{bin}/bulk_extractor", "-o", output_dir, input_file
assert (output_dir/"url.txt").read.include?("http://brew.sh")
assert (output_dir/"telephone.txt").read.include?("(201)555-1212")
end
end