class Cucumber::Formatter::Timed
Public Class Methods
new(step_mother, io, options)
click to toggle source
Calls superclass method
# File lib/timed.rb, line 15 def initialize(step_mother, io, options) @io = io @duration = 0.0 super end
Public Instance Methods
after_feature_element(scenario)
click to toggle source
# File lib/timed.rb, line 49 def after_feature_element(scenario) @io.puts " #{scenario.name} (#{@duration}s)" @duration = 0.0 end
after_steps(steps)
click to toggle source
# File lib/timed.rb, line 29 def after_steps(steps) @duration += Time.now - @my_time end
after_test_step(test_step, result)
click to toggle source
Calls superclass method
# File lib/timed.rb, line 33 def after_test_step(test_step, result) super unless result.ok? error_msg = "#{result.exception.message} (#{result.exception.class.name})\n#{result.exception.backtrace.join("\n")}" @io.puts <<-EOMESSAGE #{format_string(test_step.action_location, :comment)} #{format_string(error_msg, result.to_sym)} EOMESSAGE end end
before_feature(feature)
click to toggle source
# File lib/timed.rb, line 21 def before_feature(feature) @io.puts "#{feature.name.lines.first.chomp} [#{feature.file}]" end
before_steps(steps)
click to toggle source
# File lib/timed.rb, line 25 def before_steps(steps) @my_time = Time.now end