From f1b3d2597b0fb40a3d781157ef65c3fbd2f64d02 Mon Sep 17 00:00:00 2001 From: Jack Nagel Date: Tue, 26 Mar 2013 10:45:52 -0500 Subject: jshon: improve test --- Library/Formula/jshon.rb | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'Library/Formula') diff --git a/Library/Formula/jshon.rb b/Library/Formula/jshon.rb index 6308397a0..9caa75b91 100644 --- a/Library/Formula/jshon.rb +++ b/Library/Formula/jshon.rb @@ -14,7 +14,12 @@ class Jshon < Formula man1.install 'jshon.1' end - def test - system "echo '[true,false,null]'| #{bin}/jshon -l" + test do + require 'open3' + Open3.popen3("#{bin}/jshon", "-l") do |stdin, stdout, _| + stdin.write("[true,false,null]") + stdin.close + "3" == stdout.read.strip + end end end -- cgit v1.2.3