Sha256: 1f5b8d5ae7f297615ceab07a4cee491e97a21aa38d6cc953a16644712414959f
Contents?: true
Size: 1.87 KB
Versions: 1
Compression:
Stored size: 1.87 KB
Contents
module QED module Reporter #:nodoc: require 'qed/reporter/abstract' # = Verbose ANSI Console Reporter # class Verbatim < Abstract # def text(section) text = section.commentary text = text.gsub(/^([=#].*?)$/, '\1'.ansi(:bold)) io.print text if section.continuation? io.puts(section.clean_example.ansi(:blue)) io.puts end end # headers ? # def pass(step) txt = step.example #.rstrip.sub("\n",'') io.print "#{txt}".ansi(:green) end # def fail(step, error) txt = step.example.rstrip #.sub("\n",'') tab = step.example.index(/\S/) io.print "#{txt}\n\n".ansi(:red) msg = [] #msg << ANSI::Code.bold(ANSI::Code.red("FAIL: ")) + error.to_str #msg << ANSI::Code.bold(clean_backtrace(error.backtrace[0])) msg << "FAIL: ".ansi(:bold, :red) + error.to_str msg << clean_backtrace(error.backtrace[0]).ansi(:bold) io.puts msg.join("\n").tabto(tab||2) io.puts end # def error(step, error) raise error if $DEBUG txt = step.example.rstrip #.sub("\n",'') tab = step.example.index(/\S/) io.print "#{txt}\n\n".ansi(:red) msg = [] msg << "ERROR: #{error.class} ".ansi(:bold,:red) + error.to_str #.sub(/for QED::Context.*?$/,'') msg << clean_backtrace(error.backtrace[0]).ansi(:bold) #msg = msg.ansi(:red) io.puts msg.join("\n").tabto(tab||2) io.puts end #def report(str) # count[-1] += 1 unless count.empty? # str = str.chomp('.') + '.' # str = count.join('.') + ' ' + str # puts str.strip #end #def report_table(set) # puts set.to_yaml.tabto(2).ansi(:magenta) #end # #def macro(step) # #io.puts # #io.puts step.text # io.print "#{step}".ansi(:magenta) # #io.puts #end end end #module Reporter end #module QED
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
qed-2.3.0 | lib/qed/reporter/verbatim.rb |