Class: Megatest::Reporters::VerboseReporter

Inherits:
SimpleReporter show all
Defined in:
lib/megatest/reporters.rb

Instance Method Summary collapse

Methods inherited from SimpleReporter

#summary

Methods inherited from AbstractReporter

#initialize, #summary

Constructor Details

This class inherits a constructor from Megatest::Reporters::AbstractReporter

Instance Method Details

#after_test_case(_queue, test_case, result) ⇒ Object



138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
# File 'lib/megatest/reporters.rb', line 138

def after_test_case(_queue, test_case, result)
  if @concurrent
    @out.print("#{test_case.id} = ")
  end

  if result.skipped?
    @out.print(@out.yellow("SKIPPED"))
  elsif result.retried?
    @out.print(@out.yellow("RETRIED"))
  elsif result.error?
    @out.print(@out.red("ERROR"))
  elsif result.failed?
    @out.print(@out.red("FAILED"))
  else
    @out.print(@out.green("SUCCESS"))
  end

  if result.duration
    @out.print " (in #{result.duration.round(3)}s)"
  end

  @out.puts
  if result.bad?
    @out.puts @out.colored(render_failure(result))
  end
end

#before_test_case(_queue, test_case) ⇒ Object



132
133
134
135
136
# File 'lib/megatest/reporters.rb', line 132

def before_test_case(_queue, test_case)
  unless @concurrent
    @out.print("#{test_case.id} = ")
  end
end

#start(executor, _queue) ⇒ Object



128
129
130
# File 'lib/megatest/reporters.rb', line 128

def start(executor, _queue)
  @concurrent = executor.concurrent?
end