Sha256: 49ace71ca8b952b81e705455376d5bfa54037fac3b5a730947d4d763691966ca
Contents?: true
Size: 656 Bytes
Versions: 69
Compression:
Stored size: 656 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 MultiThreadedBehaviourRunner = MultiThreadedExampleGroupRunner
Version data entries
69 entries across 69 versions & 9 rubygems