From fa3183b08c558f321aac98c7459def0449309a3f Mon Sep 17 00:00:00 2001 From: Mike Naberezny Date: Tue, 1 Apr 2014 11:57:00 -0700 Subject: visitors: add test --- Library/Formula/visitors.rb | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'Library/Formula') diff --git a/Library/Formula/visitors.rb b/Library/Formula/visitors.rb index 7d6b36517..7db6eac7c 100644 --- a/Library/Formula/visitors.rb +++ b/Library/Formula/visitors.rb @@ -12,4 +12,13 @@ class Visitors < Formula bin.install "visitors" man1.install "visitors.1" end + + test do + IO.popen("#{bin}/visitors - -o text 2>&1", "w+") do |pipe| + pipe.puts 'a:80 1.2.3.4 - - [01/Apr/2014:14:28:00 -0400] "GET /1 HTTP/1.1" 200 9 - -' + pipe.puts 'a:80 1.2.3.4 - - [01/Apr/2014:14:28:01 -0400] "GET /2 HTTP/1.1" 200 9 - -' + pipe.close_write + assert pipe.read.include?("Different pages requested: 2") + end + end end -- cgit v1.2.3