Class: TapOut::Reporters::Verbose

Inherits:
Abstract
  • Object
show all
Defined in:
lib/tapout/reporters/verbose.rb

Overview

Verbose reporter.

Constant Summary

Constants inherited from Abstract

Abstract::INTERNALS

Instance Method Summary collapse

Methods inherited from Abstract

#<<, #clean_backtrace, #code_snippet, #finish_case, #handle, inherited, #initialize, #note, #omit, #parse_source_location, #skip, #source, #tally, #test

Constructor Details

This class inherits a constructor from TapOut::Reporters::Abstract

Instance Method Details

#err(entry) ⇒ Object



34
35
36
37
38
39
40
41
42
43
# File 'lib/tapout/reporters/verbose.rb', line 34

def err(entry)
  super(entry)
  $stdout.puts "* " + entry['label'].ansi(:yellow) + "   #{entry['source']}"
  $stdout.puts
  $stdout.puts "    #{entry['message']}"  # error class?
  #$stdout.puts "    " + ok.caller #clean_backtrace(exception.backtrace)[0..2].join("    \n")
  $stdout.puts
  $stdout.puts code_snippet(entry)
  $stdout.puts
end

#fail(entry) ⇒ Object



23
24
25
26
27
28
29
30
31
32
# File 'lib/tapout/reporters/verbose.rb', line 23

def fail(entry)
  super(entry)
  $stdout.puts "* " + entry['label'].ansi(:red) + "   #{entry['source']}"
  $stdout.puts
  $stdout.puts "    #{entry['message']}"
  #$stdout.puts "    " + ok.caller #clean_backtrace(exception.backtrace)[0]
  $stdout.puts
  $stdout.puts code_snippet(entry)
  $stdout.puts
end

#finish_suite(entry) ⇒ Object



46
47
48
49
50
# File 'lib/tapout/reporters/verbose.rb', line 46

def finish_suite(entry)
  #$stderr.puts
  $stdout.print tally(entry)
  $stdout.puts " [%0.4fs] " % [Time.now - @start_time]
end

#pass(entry) ⇒ Object



18
19
20
21
# File 'lib/tapout/reporters/verbose.rb', line 18

def pass(entry)
  super(entry)
  $stdout.puts "* " + entry['label'].ansi(:green) + "   #{entry['source']}"
end

#start_case(entry) ⇒ Object



14
15
16
# File 'lib/tapout/reporters/verbose.rb', line 14

def start_case(entry)
  $stdout.puts entry['label'].ansi(:bold)
end

#start_suite(entry) ⇒ Object



9
10
11
# File 'lib/tapout/reporters/verbose.rb', line 9

def start_suite(entry)
  @start_time = Time.now
end