From cc417a51ff21ed21f5c438885e741afbcaeb19a1 Mon Sep 17 00:00:00 2001 From: Jack Nagel Date: Sun, 24 Mar 2013 23:39:48 -0500 Subject: [PATCH] bsdconv: improve test --- Formula/bsdconv.rb | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/Formula/bsdconv.rb b/Formula/bsdconv.rb index 18b092bc90..bccea15db7 100644 --- a/Formula/bsdconv.rb +++ b/Formula/bsdconv.rb @@ -14,8 +14,12 @@ class Bsdconv < Formula system "make", "PREFIX=#{prefix}", "install" end - def test - printf = 'printf "\263\134\245\134\273\134"' - system "test `#{printf} | #{bin}/bsdconv big5:utf-8` = '許功蓋'" + test do + require 'open3' + Open3.popen3("#{bin}/bsdconv", "big5:utf-8") do |stdin, stdout, _| + stdin.write("\263\134\245\134\273\134") + stdin.close + stdout.read == "許功蓋" + end end end