From 538c9491097a1f6ca40e5a9c8bd3a4ead2467d9c Mon Sep 17 00:00:00 2001 From: Mike Naberezny Date: Sat, 12 Apr 2014 17:44:19 -0700 Subject: [PATCH] bulk_extractor: add test Closes Homebrew/homebrew#28362. Signed-off-by: Adam Vandenberg --- Formula/bulk_extractor.rb | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/Formula/bulk_extractor.rb b/Formula/bulk_extractor.rb index 60fba2a8e0..e0ba492811 100644 --- a/Formula/bulk_extractor.rb +++ b/Formula/bulk_extractor.rb @@ -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