Class: Cucumber::Formatter::DurationExtractor

Inherits:
Object
  • Object
show all
Defined in:
lib/cucumber/formatter/duration_extractor.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(result) ⇒ DurationExtractor

Returns a new instance of DurationExtractor



7
8
9
10
# File 'lib/cucumber/formatter/duration_extractor.rb', line 7

def initialize(result)
  @result_duration = 0
  result.describe_to(self)
end

Instance Attribute Details

#result_durationObject (readonly)

Returns the value of attribute result_duration



6
7
8
# File 'lib/cucumber/formatter/duration_extractor.rb', line 6

def result_duration
  @result_duration
end

Instance Method Details

#duration(duration) ⇒ Object



24
25
26
# File 'lib/cucumber/formatter/duration_extractor.rb', line 24

def duration(duration, *)
  duration.tap { |duration| @result_duration = duration.nanoseconds / 10**9.0 }
end

#exceptionObject



22
# File 'lib/cucumber/formatter/duration_extractor.rb', line 22

def exception(*) end

#failedObject



14
# File 'lib/cucumber/formatter/duration_extractor.rb', line 14

def failed(*) end

#passedObject



12
# File 'lib/cucumber/formatter/duration_extractor.rb', line 12

def passed(*) end

#pendingObject



20
# File 'lib/cucumber/formatter/duration_extractor.rb', line 20

def pending(*) end

#skippedObject



18
# File 'lib/cucumber/formatter/duration_extractor.rb', line 18

def skipped(*) end

#undefinedObject



16
# File 'lib/cucumber/formatter/duration_extractor.rb', line 16

def undefined(*) end