test/command_line_helper.rb in compass-edge-0.9.4 vs test/command_line_helper.rb in compass-edge-0.9.5.0

- old
+ new

@@ -28,27 +28,31 @@ io.puts response end end end responder.assert_required_responses! - @last_result = output + @last_result = decolorize(output) else #child process execute *arguments end end else @last_error = capture_warning do - @last_result = capture_output do + @last_result = decolorize(capture_output do @last_exit_code = execute *arguments - end + end) 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 @@ -77,10 +81,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.join(", ")}" if actions_found.any? + message += "The following actions were performed: #{actions_found.map{|a|a.inspect}.join(", ")}" if actions_found.any? puts @last_result fail message end def within_tmp_directory(dir = "tmp")