Sha256: cc16e7a74c63cecf7399154d28879dada01914d988af703a7b79610cd8597841

Contents?: true

Size: 632 Bytes

Versions: 9

Compression:

Stored size: 632 Bytes

Contents

require 'parallel_tests/cucumber/io'

module ParallelTests
  module Cucumber
    class RuntimeLogger
      include Io

      def initialize(step_mother, path_or_io, options=nil)
        @io = prepare_io(path_or_io)
        @example_times = Hash.new(0)
      end

      def before_feature(_)
        @start_at = ParallelTests.now.to_f
      end

      def after_feature(feature)
        @example_times[feature.file] += ParallelTests.now.to_f - @start_at
      end

      def after_features(*args)
        lock_output do
          @io.puts @example_times.map { |file, time| "#{file}:#{time}" }
        end
      end
    end
  end
end

Version data entries

9 entries across 9 versions & 2 rubygems

Version Path
vinted-parallel_tests-0.13.3 lib/parallel_tests/cucumber/runtime_logger.rb
parallel_tests-0.13.3 lib/parallel_tests/cucumber/runtime_logger.rb
parallel_tests-0.13.2 lib/parallel_tests/cucumber/runtime_logger.rb
parallel_tests-0.13.1 lib/parallel_tests/cucumber/runtime_logger.rb
parallel_tests-0.13.0 lib/parallel_tests/cucumber/runtime_logger.rb
parallel_tests-0.12.4 lib/parallel_tests/cucumber/runtime_logger.rb
parallel_tests-0.12.3 lib/parallel_tests/cucumber/runtime_logger.rb
parallel_tests-0.12.2 lib/parallel_tests/cucumber/runtime_logger.rb
parallel_tests-0.12.1 lib/parallel_tests/cucumber/runtime_logger.rb