aboutsummaryrefslogtreecommitdiffstats
path: root/Library
diff options
context:
space:
mode:
authorMike Naberezny2014-04-12 17:44:19 -0700
committerAdam Vandenberg2014-04-12 21:30:59 -0700
commitbfc64099fab45b4b46c41760573c503107e523fb (patch)
tree3583e9ab84fa7394264a7fe62a67fce9768eefde /Library
parent7fda10dfe85fcbbbb0f19048e3f258adfda4ef2e (diff)
downloadhomebrew-bfc64099fab45b4b46c41760573c503107e523fb.tar.bz2
bulk_extractor: add test
Closes #28362. Signed-off-by: Adam Vandenberg <flangy@gmail.com>
Diffstat (limited to 'Library')
-rw-r--r--Library/Formula/bulk_extractor.rb11
1 files changed, 11 insertions, 0 deletions
diff --git a/Library/Formula/bulk_extractor.rb b/Library/Formula/bulk_extractor.rb
index 60fba2a8e..e0ba49281 100644
--- a/Library/Formula/bulk_extractor.rb
+++ b/Library/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