From 3c02e6a9cc850ff80f9d016a68a1997b81d655cd Mon Sep 17 00:00:00 2001 From: Jack Nagel Date: Tue, 26 Mar 2013 10:58:44 -0500 Subject: [PATCH] justniffer: improve test --- Formula/justniffer.rb | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/Formula/justniffer.rb b/Formula/justniffer.rb index c62fb58037..8716d33b5d 100644 --- a/Formula/justniffer.rb +++ b/Formula/justniffer.rb @@ -40,8 +40,11 @@ class Justniffer < Formula system "make install" end - def test - system "#{bin}/justniffer --version | grep '^justniffer'" + test do + require 'open3' + Open3.popen3("#{bin}/justniffer", "--version") do |_, stdout, _| + /justniffer #{Regexp.escape(version)}/ === stdout.read + end end def caveats; <<-EOS.undent