Class Index [+]

Quicksearch

Bacon::PrettyOutput

Constants

NAME
RamazeLogger

Public Instance Methods

general_error() click to toggle source

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
handle_requirement(description) click to toggle source

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
handle_specification(name) click to toggle source

store name and run

    # File lib/ramaze/spec/helper/pretty_output.rb, line 6
 6:     def handle_specification(name)
 7:       NAME.replace name
 8:                         puts NAME
 9:       yield
10:                         puts
11:     end
handle_summary() click to toggle source

output summary

    # File lib/ramaze/spec/helper/pretty_output.rb, line 44
44:     def handle_summary
45:             puts
46:       puts "%d tests, %d assertions, %d failures, %d errors" %
47:         Counter.values_at(:specifications, :requirements, :failed, :errors)
48:     end

Disabled; run with --debug to generate this.

[Validate]

Generated with the Darkfish Rdoc Generator 1.1.6.