Class: Megatest::Reporters::VerboseReporter

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

Instance Method Summary collapse

Methods inherited from SimpleReporter

#ms, #s, #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



168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
# File 'lib/megatest/reporters.rb', line 168

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



162
163
164
165
166
# File 'lib/megatest/reporters.rb', line 162

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

#start(executor, _queue) ⇒ Object



157
158
159
160
# File 'lib/megatest/reporters.rb', line 157

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