Show nicer output on error
# File lib/ramaze/spec/helper/pretty_output.rb, line 35 35: def general_error 36: puts "", ErrorLog 37: ErrorLog.scan(/^\s*(.*?):(\d+): #{NAME} - (.*?)$/) do 38: puts "#{ENV['EDITOR'] || 'vim'} #$1 +#$2 # #$3" 39: end 40: ErrorLog.replace '' 41: end
Core, yields the requirement and outputs problems
# File lib/ramaze/spec/helper/pretty_output.rb, line 14 14: def handle_requirement(description) 15: print "- #{description}\n" 16: error = yield 17: 18: unless error.empty? 19: if defined?(Ramaze::Logging) 20: puts '', " #{NAME} -- #{description} [FAILED]".center(70, '-'), '' 21: colors = Ramaze::Logger::Informer::COLORS 22: 23: until RamazeLogger.history.empty? 24: tag, line = RamazeLogger.history.shift 25: out = "%6s | %s" % [tag.to_s, line] 26: puts out.send(colors[tag]) 27: end 28: end 29: 30: general_error 31: end 32: end
Disabled; run with --debug to generate this.
Generated with the Darkfish Rdoc Generator 1.1.6.