Show nicer output on error
# File lib/ramaze/spec/helper/pretty_output.rb, line 35 def general_error puts "", ErrorLog ErrorLog.scan(/^\s*(.*?):(\d+): #{NAME} - (.*?)$/) do puts "#{ENV['EDITOR'] || 'vim'} #$1 +#$2 # #$3" end ErrorLog.replace '' end
Core, yields the requirement and outputs problems
# File lib/ramaze/spec/helper/pretty_output.rb, line 14 def handle_requirement(description) print "- #{description}\n" error = yield unless error.empty? if defined?(Ramaze::Logging) puts '', " #{NAME} -- #{description} [FAILED]".center(70, '-'), '' colors = Ramaze::Logger::Informer::COLORS until RamazeLogger.history.empty? tag, line = RamazeLogger.history.shift out = "%6s | %s" % [tag.to_s, line] puts out.send(colors[tag]) end end general_error end end
Generated with the Darkfish Rdoc Generator 2.