5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
|
# File 'lib/rspec_tracer/rspec_runner.rb', line 5
def run_specs(example_groups)
actual_count = RSpec.world.example_count
if _no_examples?(actual_count)
super
return
end
starting = Process.clock_gettime(Process::CLOCK_MONOTONIC)
filtered_examples, filtered_example_groups = RSpecTracer.filter_examples
if _duplicate_examples?
super([])
return
end
RSpec.world.instance_variable_set(:@filtered_examples, filtered_examples)
RSpec.world.instance_variable_set(:@example_groups, filtered_example_groups)
current_count = RSpec.world.example_count
ending = Process.clock_gettime(Process::CLOCK_MONOTONIC)
elapsed = RSpecTracer::TimeFormatter.format_time(ending - starting)
RSpecTracer.logger.info <<-EXAMPLES.strip.gsub(/\s+/, ' ')
RSpec tracer is running #{current_count} examples (actual: #{actual_count},
skipped: #{actual_count - current_count}) (took #{elapsed})
EXAMPLES
RSpecTracer.running = true
super(filtered_example_groups)
end
|