Sha256: b0effbaebbdc3b86e124f5ecfaf5ba6117988df92de20474890d9ea891202e3c
Contents?: true
Size: 592 Bytes
Versions: 70
Compression:
Stored size: 592 Bytes
Contents
class MultiThreadedExampleGroupRunner < Spec::Runner::ExampleGroupRunner def initialize(options, arg) super(options) # configure these @thread_count = 4 @thread_wait = 0 end def run @threads = [] q = Queue.new example_groups.each { |b| q << b} success = true @thread_count.times do @threads << Thread.new(q) do |queue| while not queue.empty? example_group = queue.pop success &= example_group.suite.run(nil) end end sleep @thread_wait end @threads.each {|t| t.join} success end end
Version data entries
70 entries across 70 versions & 14 rubygems