Class: RSpec::Core::QueueRunner

Inherits:
CommandLine
  • Object
show all
Defined in:
lib/test_queue/runner/rspec3.rb,
lib/test_queue/runner/rspec2.rb

Instance Method Summary collapse

Constructor Details

#initializeQueueRunner

Returns a new instance of QueueRunner.



18
19
20
21
# File 'lib/test_queue/runner/rspec3.rb', line 18

def initialize
  options = ConfigurationOptions.new(ARGV)
  super(options)
end

Instance Method Details

#run_specs(iterator) ⇒ Object Also known as: run_each



23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
# File 'lib/test_queue/runner/rspec3.rb', line 23

def run_specs(iterator)
  @configuration.reporter.report(0) do |reporter|
    @configuration.with_suite_hooks do
      iterator.map { |g|
        start = Time.now
        if g.is_a? ::RSpec::Core::Example
          print "    #{g.full_description}: "
          example = g
          g = example.example_group
          ::RSpec.world.filtered_examples.clear
          ::RSpec.world.filtered_examples[g] = [example]
        else
          print "    #{g.description}: "
        end
        ret = g.run(reporter)
        diff = Time.now-start
        puts("  <%.3f>" % diff)

        ret
      }.all? ? 0 : @configuration.failure_exit_code
    end
  end
end