Sha256: f4d7f5802213f2948b002c78eb1c76048b74b7d1dd28db5751657b34e60b1fca
Contents?: true
Size: 1.56 KB
Versions: 3
Compression:
Stored size: 1.56 KB
Contents
require 'test_queue/runner' require 'rspec/core' module RSpec::Core class QueueRunner < CommandLine def initialize super(ARGV) end def example_groups @options.configure(@configuration) @configuration.load_spec_files @world.announce_filters @world.example_groups end def run_each(iterator) @configuration.error_stream = $stderr @configuration.output_stream = $stdout @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 end end module TestQueue class Runner class RSpec < Runner def initialize @rspec = ::RSpec::Core::QueueRunner.new super(@rspec.example_groups.sort_by{ |s| -(stats[s.description] || 0) }) end def run_worker(iterator) @rspec.run_each(iterator) end def summarize_worker(worker) worker.stats.each do |s, val| stats[s.description] = val end num_tests = worker.lines.grep(/ examples?, /).first failures = worker.output[/^Failures:\n\n(.*)\n^Finished/m, 1] [ num_tests, failures ] end end end end
Version data entries
3 entries across 3 versions & 1 rubygems
Version | Path |
---|---|
test-queue-0.1.2 | lib/test_queue/runner/rspec.rb |
test-queue-0.1.1 | lib/test_queue/runner/rspec.rb |
test-queue-0.1.0 | lib/test_queue/runner/rspec.rb |