Class: RSpec::Core::QueueRunner

Inherits:
CommandLine
  • Object
show all
Defined in:
lib/test_queue/runner/rspec.rb

Instance Method Summary collapse

Constructor Details

#initializeQueueRunner

Returns a new instance of QueueRunner.



6
7
8
9
10
# File 'lib/test_queue/runner/rspec.rb', line 6

def initialize
  super(ARGV)
  @configuration.output_stream = $stdout
  @configuration.error_stream  = $stderr
end

Instance Method Details

#example_groupsObject



12
13
14
15
16
17
# File 'lib/test_queue/runner/rspec.rb', line 12

def example_groups
  @options.configure(@configuration)
  @configuration.load_spec_files
  @world.announce_filters
  @world.example_groups
end

#run_each(iterator) ⇒ Object



19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
# File 'lib/test_queue/runner/rspec.rb', line 19

def run_each(iterator)
  @configuration.reporter.report(0, @configuration.randomize? ? @configuration.seed : nil) do |reporter|
    begin
      @configuration.run_hook(:before, :suite)
      iterator.map {|g|
        print "    #{g.description}: "
        start = Time.now
        ret = g.run(reporter)
        diff = Time.now-start
        puts("  <%.3f>" % diff)

        ret
      }.all? ? 0 : @configuration.failure_exit_code
    ensure
      @configuration.run_hook(:after, :suite)
    end
  end
end