Sha256: 8034ea795300f619b1aef3470844171313e69f813b1c8c28152de29557e21315

Contents?: true

Size: 791 Bytes

Versions: 8

Compression:

Stored size: 791 Bytes

Contents

# -*- coding: utf-8 -*-

require 'turnip_formatter/printer'
require 'ostruct'

module TurnipFormatter
  module Printer
    class TabSpeedStatistics
      class << self
        include TurnipFormatter::Printer

        def print_out(passed_scenarios)
          results = speed_analysis(passed_scenarios)
          render_template(:tab_speed_statistics, { analysis_results: results })
        end

        private

        def speed_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

8 entries across 8 versions & 1 rubygems

Version Path
turnip_formatter-0.2.11 lib/turnip_formatter/printer/tab_speed_statistics.rb
turnip_formatter-0.2.10 lib/turnip_formatter/printer/tab_speed_statistics.rb
turnip_formatter-0.2.9 lib/turnip_formatter/printer/tab_speed_statistics.rb
turnip_formatter-0.2.8 lib/turnip_formatter/printer/tab_speed_statistics.rb
turnip_formatter-0.2.7 lib/turnip_formatter/printer/tab_speed_statistics.rb
turnip_formatter-0.2.6 lib/turnip_formatter/printer/tab_speed_statistics.rb
turnip_formatter-0.2.5 lib/turnip_formatter/printer/tab_speed_statistics.rb
turnip_formatter-0.2.4 lib/turnip_formatter/printer/tab_speed_statistics.rb