class Result

Attributes

duration_raw[RW]
example_count[RW]
identifier[R]

Public Class Methods

new(identifier) click to toggle source
# File lib/rspec_overview/result.rb, line 5
def initialize(identifier)
  @identifier = identifier
  @example_count = 0
  @duration_raw = 0.0
end

Public Instance Methods

avg_duration_seconds() click to toggle source
# File lib/rspec_overview/result.rb, line 11
def avg_duration_seconds
  format_seconds(duration_raw / example_count)
end
duration_seconds() click to toggle source
# File lib/rspec_overview/result.rb, line 15
def duration_seconds
  format_seconds(duration_raw)
end
to_a() click to toggle source
# File lib/rspec_overview/result.rb, line 19
def to_a
  [identifier, example_count, duration_seconds, avg_duration_seconds]
end

Private Instance Methods

format_seconds(duration) click to toggle source
# File lib/rspec_overview/result.rb, line 25
def format_seconds(duration)
  RSpec::Core::Formatters::Helpers.format_seconds(duration)
end