From ecdde2f80db5527082a4a40fe44a47ad2133c9e3 Mon Sep 17 00:00:00 2001 From: Jack Nagel Date: Sun, 24 Mar 2013 23:29:37 -0500 Subject: cloog: fix test --- Library/Formula/cloog.rb | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'Library/Formula') diff --git a/Library/Formula/cloog.rb b/Library/Formula/cloog.rb index 7b094daac..13329b1b5 100644 --- a/Library/Formula/cloog.rb +++ b/Library/Formula/cloog.rb @@ -16,7 +16,7 @@ class Cloog < Formula system "make install" end - def test + test do cloog_source = <<-EOS.undent c @@ -33,8 +33,11 @@ class Cloog < Formula 0 EOS - pipe = IO.popen("cloog /dev/stdin", "w+") - pipe.write(cloog_source) - pipe.read =~ /Generated\ from \/dev\/stdin\ by\ CLooG/ + require 'open3' + Open3.popen3("#{bin}/cloog", "/dev/stdin") do |stdin, stdout, _| + stdin.write(cloog_source) + stdin.close + /Generated from \/dev\/stdin by CLooG/ === stdout.read + end end end -- cgit v1.2.3