Skip to content

Commit

Permalink
Handle nil durations
Browse files Browse the repository at this point in the history
  • Loading branch information
sj26 committed Sep 29, 2022
1 parent ed30088 commit 49222dc
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/rspec_junit_formatter.rb
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,9 @@ def xml_dump_example(example)
output << %{ classname="#{escape(classname_for(example))}"}
output << %{ name="#{escape(description_for(example))}"}
output << %{ file="#{escape(example_group_file_path_for(example))}"}
output << %{ time="#{escape("%.6f" % duration_for(example))}"}
if duration = duration_for(example)
output << %{ time="#{escape("%.6f" % duration)}"}
end
output << %{>}
yield if block_given?
xml_dump_output(example)
Expand Down

0 comments on commit 49222dc

Please sign in to comment.