jshon: improve test

This commit is contained in:
Jack Nagel 2013-03-26 10:45:52 -05:00
parent 67949d44c0
commit 54b061f418

View file

@ -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