Module: Bacon::PrettyOutput
- Included in:
- Bacon
- Defined in:
- lib/ramaze/spec/helper/pretty_output.rb,
lib/ramaze/spec/helper/pretty_output.rb
Constant Summary collapse
- NAME =
''
- RamazeLogger =
Ramaze::SpecLogger.new
Instance Method Summary collapse
-
#general_error ⇒ Object
Show nicer output on error.
-
#handle_requirement(description) ⇒ Object
Core, yields the requirement and outputs problems.
-
#handle_specification(name) ⇒ Object
store name and run.
-
#handle_summary ⇒ Object
output summary.
Instance Method Details
#general_error ⇒ Object
Show nicer output on error
35 36 37 38 39 40 41 |
# 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 |
#handle_requirement(description) ⇒ Object
Core, yields the requirement and outputs problems
14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 |
# 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::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 |