lib/rspec_tracer/html_reporter/reporter.rb in rspec-tracer-0.9.1 vs lib/rspec_tracer/html_reporter/reporter.rb in rspec-tracer-0.9.2
- old
+ new
@@ -58,11 +58,23 @@
@reporter.all_examples.each_pair do |example_id, example|
@examples[example_id] = {
id: example_id,
description: example[:full_description],
location: example_location(example[:rerun_file_name], example[:rerun_line_number]),
- status: example[:run_reason] || 'Skipped',
+ status: example[:run_reason] || 'Skipped'
+ }.merge(example_result(example_id, example))
+ end
+ end
+
+ def example_result(example_id, example)
+ if example[:execution_result].nil?
+ {
+ result: @reporter.example_interrupted?(example_id) ? 'Interrupted' : '_',
+ last_run: '_'
+ }
+ else
+ {
result: example[:execution_result][:status].capitalize,
last_run: example_run_local_time(example[:execution_result][:finished_at])
}
end
end
@@ -174,11 +186,11 @@
ERB.new(File.read(File.join(File.dirname(__FILE__), 'views/', "#{name}.erb")))
end
def example_status_css_class(example_status)
case example_status.split.first
- when 'Failed', 'Flaky'
+ when 'Failed', 'Flaky', 'Interrupted'
'red'
when 'Pending'
'yellow'
else
'blue'
@@ -187,10 +199,10 @@
def example_result_css_class(example_result)
case example_result
when 'Passed'
'green'
- when 'Failed'
+ when 'Failed', 'Interrupted'
'red'
when 'Pending'
'yellow'
else
'blue'