Sha256: 98c328d1657218f2a0344a1b25853320aaa40e03c329e7ffc9be065c054b503c

Contents?: true

Size: 873 Bytes

Versions: 11

Compression:

Stored size: 873 Bytes

Contents

require 'turnip_formatter/renderer/html/base'
require 'ostruct'

module TurnipFormatter
  module Renderer
    module Html
      #
      # @resource [Array<TurnipFormatter::Resource::Scenario::XXX>]
      #
      class StatisticsSpeed < Base
        def results
          @results ||= analysis(scenarios)
        end

        private

        #
        # Use the successfully steps only
        #
        def scenarios
          @scenarios ||= @resource.select { |s| s.status == :passed }
        end

        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
      end
    end
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
turnip_formatter-0.8.0 lib/turnip_formatter/renderer/html/statistics_speed.rb
turnip_formatter-0.7.2 lib/turnip_formatter/renderer/html/statistics_speed.rb
turnip_formatter-0.7.1 lib/turnip_formatter/renderer/html/statistics_speed.rb
turnip_formatter-0.7.0 lib/turnip_formatter/renderer/html/statistics_speed.rb
turnip_formatter-0.6.1 lib/turnip_formatter/renderer/html/statistics_speed.rb
turnip_formatter-0.6.0 lib/turnip_formatter/renderer/html/statistics_speed.rb
turnip_formatter-0.6.0.pre.beta.7 lib/turnip_formatter/renderer/html/statistics_speed.rb
turnip_formatter-0.6.0.pre.beta.6 lib/turnip_formatter/renderer/html/statistics_speed.rb
turnip_formatter-0.6.0.pre.beta.5 lib/turnip_formatter/renderer/html/statistics_speed.rb
turnip_formatter-0.6.0.pre.beta.4 lib/turnip_formatter/renderer/html/statistics_speed.rb
turnip_formatter-0.6.0.pre.beta.3 lib/turnip_formatter/renderer/html/statistics_speed.rb