test/command_line_helper.rb in compass-edge-0.9.5.0 vs test/command_line_helper.rb in compass-edge-0.10.0.pre

- old
+ new

@@ -1,7 +1,5 @@ -require 'timeout' - module Compass::CommandLineHelper def compass(*arguments) options = arguments.last.is_a?(Hash) ? arguments.pop : {} options[:wait] = 0.25 if block_given? @@ -28,31 +26,25 @@ io.puts response end end end responder.assert_required_responses! - @last_result = decolorize(output) + @last_result = output else #child process execute *arguments end end else - @last_error = capture_warning do - @last_result = decolorize(capture_output do - @last_exit_code = execute *arguments - end) + @last_result = capture_output do + execute *arguments end end rescue Timeout::Error fail "Read from child process timed out" end - def decolorize(str) - str.gsub(/\e\[\d+m/,'') - end - class Responder Response = Struct.new(:prompt, :text, :required, :responded) def initialize @responses = [] end @@ -81,10 +73,10 @@ line = line.split return if line.first == action.to_s && line.last == path actions_found << line.first if line.last == path end message = "Action #{action.inspect} was not performed on: #{path}." - message += "The following actions were performed: #{actions_found.map{|a|a.inspect}.join(", ")}" if actions_found.any? + message += "The following actions were performed: #{actions_found.join(", ")}" if actions_found.any? puts @last_result fail message end def within_tmp_directory(dir = "tmp")