From 1beab7853ac2d01c6ed6bdbdd50328b2d2bef4c9 Mon Sep 17 00:00:00 2001 From: Chris Eppstein Date: Sat, 20 Jun 2009 10:25:44 -0700 Subject: [PATCH] [Unit Tests] Allow the wait time to be configured as an option, default to less time. --- test/command_line_helper.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/test/command_line_helper.rb b/test/command_line_helper.rb index 5601873e..2291238f 100644 --- a/test/command_line_helper.rb +++ b/test/command_line_helper.rb @@ -1,5 +1,7 @@ module Compass::CommandLineHelper def compass(*arguments) + options = arguments.last.is_a?(Hash) ? arguments.pop : {} + options[:wait] = 0.25 if block_given? responder = Responder.new yield responder @@ -8,7 +10,7 @@ module Compass::CommandLineHelper #parent process output = "" eof_at = nil - while !eof_at || (Time.now - eof_at < 1) + while !eof_at || (Time.now - eof_at < options[:wait]) if io.eof? eof_at ||= Time.now sleep 0.1