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.



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

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

Instance Attribute Details

#result_durationObject (readonly)

Returns the value of attribute result_duration.



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

def result_duration
  @result_duration
end

Instance Method Details

#duration(duration) ⇒ Object



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

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

#exceptionObject



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

def exception(*) end

#failedObject



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

def failed(*) end

#passedObject



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

def passed(*) end

#pendingObject



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

def pending(*) end

#skippedObject



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

def skipped(*) end

#undefinedObject



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

def undefined(*) end