class TurnipFormatter::Renderer::Html::StatisticsSpeed

@resource [Array<TurnipFormatter::Resource::Scenario::XXX>]

Public Instance Methods

results() click to toggle source
# File lib/turnip_formatter/renderer/html/statistics_speed.rb, line 11
def results
  @results ||= analysis(scenarios)
end

Private Instance Methods

analysis(scenarios) click to toggle source
# File lib/turnip_formatter/renderer/html/statistics_speed.rb, line 24
def analysis(scenarios)
  scenarios.map do |s|
    OpenStruct.new(
      {
        id: s.id,
        feature_name: s.feature.name,
        name: s.name,
        run_time: s.run_time
      }
    )
  end.sort { |a, b| a.run_time <=> b.run_time }
end
scenarios() click to toggle source

Use the successfully steps only

# File lib/turnip_formatter/renderer/html/statistics_speed.rb, line 20
def scenarios
  @scenarios ||= @resource.select { |s| s.status == :passed }
end