Skip to content

Commit

Permalink
Use #tap to pass the duration value to the JSON formatter
Browse files Browse the repository at this point in the history
  • Loading branch information
brasmusson committed Oct 29, 2014
1 parent bf0c432 commit 00e9701
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions lib/cucumber/formatter/gherkin_formatter_adapter.rb
Original file line number Diff line number Diff line change
Expand Up @@ -139,9 +139,7 @@ def before_examples(examples)
#used for capturing duration
def after_step(step)
unless @outline and @options[:expand] and not @in_instantiated_scenario
if not step.duration.nil?
@gf.append_duration(step.duration.duration / 10 ** 9.0)
end
step.duration.tap { |duration| @gf.append_duration(duration.nanoseconds / 10 ** 9.0) }
end
end

Expand Down

0 comments on commit 00e9701

Please sign in to comment.