Sha256: 7aa0460d36d252006d53d9cce97743a89eb35fa8b5f376161650ebc115cfd634

Contents?: true

Size: 1010 Bytes

Versions: 5

Compression:

Stored size: 1010 Bytes

Contents

# frozen_string_literal: true

module RSpecTracer
  module RSpecRunner
    # rubocop:disable Metrics/AbcSize
    def run_specs(_example_groups)
      actual_count = RSpec.world.example_count
      starting = Process.clock_gettime(Process::CLOCK_MONOTONIC)
      filtered_examples, example_groups = RSpecTracer.filter_examples

      RSpec.world.instance_variable_set(:@filtered_examples, filtered_examples)
      RSpec.world.instance_variable_set(:@example_groups, example_groups)

      current_count = RSpec.world.example_count
      ending = Process.clock_gettime(Process::CLOCK_MONOTONIC)
      elpased = RSpecTracer::TimeFormatter.format_time(ending - starting)

      puts
      puts <<-EXAMPLES.strip.gsub(/\s+/, ' ')
        RSpec tracer is running #{current_count} examples (actual: #{actual_count},
        skipped: #{actual_count - current_count}) (took #{elpased})
      EXAMPLES

      RSpecTracer.running = true

      super(example_groups)
    end
    # rubocop:enable Metrics/AbcSize
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
rspec-tracer-0.8.0 lib/rspec_tracer/rspec_runner.rb
rspec-tracer-0.7.0 lib/rspec_tracer/rspec_runner.rb
rspec-tracer-0.6.2 lib/rspec_tracer/rspec_runner.rb
rspec-tracer-0.6.1 lib/rspec_tracer/rspec_runner.rb
rspec-tracer-0.6.0 lib/rspec_tracer/rspec_runner.rb