Class: Grntest::Reporters::StreamReporter

Inherits:
BaseReporter show all
Defined in:
lib/grntest/reporters/stream-reporter.rb

Instance Method Summary collapse

Constructor Details

#initialize(tester) ⇒ StreamReporter

Returns a new instance of StreamReporter.



21
22
23
# File 'lib/grntest/reporters/stream-reporter.rb', line 21

def initialize(tester)
  super
end

Instance Method Details

#on_finish(result) ⇒ Object



108
109
110
111
# File 'lib/grntest/reporters/stream-reporter.rb', line 108

def on_finish(result)
  puts
  report_summary(result)
end

#on_start(result) ⇒ Object



25
26
# File 'lib/grntest/reporters/stream-reporter.rb', line 25

def on_start(result)
end

#on_suite_finish(worker) ⇒ Object



102
103
# File 'lib/grntest/reporters/stream-reporter.rb', line 102

def on_suite_finish(worker)
end

#on_suite_start(worker) ⇒ Object



31
32
33
34
35
36
37
38
39
# File 'lib/grntest/reporters/stream-reporter.rb', line 31

def on_suite_start(worker)
  return unless single_worker?
  if worker.suite_name.bytesize <= @term_width
    puts(worker.suite_name)
  else
    puts(justify(worker.suite_name, @term_width))
  end
  @output.flush
end

#on_test_failure(worker, result) ⇒ Object



60
61
62
63
64
65
66
# File 'lib/grntest/reporters/stream-reporter.rb', line 60

def on_test_failure(worker, result)
  synchronize do
    report_full_test_name(worker) unless single_worker?
    report_test_result(result, worker.status)
    report_failure(result)
  end
end

#on_test_finish(worker, result) ⇒ Object



99
100
# File 'lib/grntest/reporters/stream-reporter.rb', line 99

def on_test_finish(worker, result)
end

#on_test_leak(worker, result) ⇒ Object



68
69
70
71
72
73
74
# File 'lib/grntest/reporters/stream-reporter.rb', line 68

def on_test_leak(worker, result)
  synchronize do
    report_full_test_name(worker) unless single_worker?
    report_test_result(result, worker.status)
    report_actual(result) unless result.checked?
  end
end

#on_test_no_check(worker, result) ⇒ Object



91
92
93
94
95
96
97
# File 'lib/grntest/reporters/stream-reporter.rb', line 91

def on_test_no_check(worker, result)
  synchronize do
    report_full_test_name(worker) unless single_worker?
    report_test_result(result, worker.status)
    report_actual(result)
  end
end

#on_test_omission(worker, result) ⇒ Object



76
77
78
79
80
81
82
# File 'lib/grntest/reporters/stream-reporter.rb', line 76

def on_test_omission(worker, result)
  synchronize do
    report_full_test_name(worker) unless single_worker?
    report_test_result(result, worker.status)
    report_actual(result)
  end
end

#on_test_omission_suppressed(worker, result) ⇒ Object



84
85
86
87
88
89
# File 'lib/grntest/reporters/stream-reporter.rb', line 84

def on_test_omission_suppressed(worker, result)
  synchronize do
    report_full_test_name(worker) unless single_worker?
    report_test_result(result, worker.status)
  end
end

#on_test_start(worker) ⇒ Object



41
42
43
44
45
46
47
48
49
50
51
# File 'lib/grntest/reporters/stream-reporter.rb', line 41

def on_test_start(worker)
  synchronize do
    if single_worker?
      print("  #{worker.test_name}")
    else
      report_full_test_name(worker)
      report_right_message("[start]")
    end
    @output.flush
  end
end

#on_test_success(worker, result) ⇒ Object



53
54
55
56
57
58
# File 'lib/grntest/reporters/stream-reporter.rb', line 53

def on_test_success(worker, result)
  synchronize do
    report_full_test_name(worker) unless single_worker?
    report_test_result(result, worker.status)
  end
end

#on_worker_finish(worker_id) ⇒ Object



105
106
# File 'lib/grntest/reporters/stream-reporter.rb', line 105

def on_worker_finish(worker_id)
end

#on_worker_start(worker) ⇒ Object



28
29
# File 'lib/grntest/reporters/stream-reporter.rb', line 28

def on_worker_start(worker)
end