class RSpec::Core::QueueRunner

Public Class Methods

new() click to toggle source
Calls superclass method
# File lib/test_queue/runner/rspec2.rb, line 3
def initialize
  super(ARGV)
  @configuration.output_stream = $stdout
  @configuration.error_stream  = $stderr
end

Public Instance Methods

example_groups() click to toggle source
# File lib/test_queue/runner/rspec2.rb, line 9
def example_groups
  @options.configure(@configuration)
  @configuration.load_spec_files
  @world.announce_filters
  @world.example_groups
end
run_each(iterator) click to toggle source
# File lib/test_queue/runner/rspec2.rb, line 16
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
run_specs(iterator) click to toggle source
# File lib/test_queue/runner/rspec3.rb, line 28
def run_specs(iterator)
  @configuration.reporter.report(@world.ordered_example_groups.count) 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
Also aliased as: run_each