From 54b061f418bbaa4ba6d55e18982330471ccf4a6d Mon Sep 17 00:00:00 2001 From: Jack Nagel Date: Tue, 26 Mar 2013 10:45:52 -0500 Subject: [PATCH] jshon: improve test --- Formula/jshon.rb | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/Formula/jshon.rb b/Formula/jshon.rb index 6308397a05..9caa75b912 100644 --- a/Formula/jshon.rb +++ b/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