Class: Cucumber::Formatter::ResultBuilder

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(result) ⇒ ResultBuilder

Returns a new instance of ResultBuilder.



241
242
243
244
# File 'lib/cucumber/formatter/junit.rb', line 241

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

Instance Attribute Details

#statusObject (readonly)

Returns the value of attribute status.



240
241
242
# File 'lib/cucumber/formatter/junit.rb', line 240

def status
  @status
end

#test_case_durationObject (readonly)

Returns the value of attribute test_case_duration.



240
241
242
# File 'lib/cucumber/formatter/junit.rb', line 240

def test_case_duration
  @test_case_duration
end

Instance Method Details

#duration(duration) ⇒ Object



269
270
271
# File 'lib/cucumber/formatter/junit.rb', line 269

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

#exceptionObject



266
267
# File 'lib/cucumber/formatter/junit.rb', line 266

def exception(*)
end

#failedObject



250
251
252
# File 'lib/cucumber/formatter/junit.rb', line 250

def failed
  @status = :failed
end

#passedObject



246
247
248
# File 'lib/cucumber/formatter/junit.rb', line 246

def passed
  @status = :passed
end

#pendingObject



262
263
264
# File 'lib/cucumber/formatter/junit.rb', line 262

def pending(*)
  @status = :pending
end

#skippedObject



258
259
260
# File 'lib/cucumber/formatter/junit.rb', line 258

def skipped
  @status = :skipped
end

#undefinedObject



254
255
256
# File 'lib/cucumber/formatter/junit.rb', line 254

def undefined
  @status = :undefined
end