lib/test_queue/runner/rspec.rb in test-queue-0.7.0 vs lib/test_queue/runner/rspec.rb in test-queue-0.8.0

- old
+ new

@@ -1,15 +1,17 @@ +# frozen_string_literal: true + require_relative '../runner' require 'rspec/core' -case ::RSpec::Core::Version::STRING.to_i +case RSpec::Core::Version::STRING.to_i when 2 require_relative 'rspec2' when 3, 4 require_relative 'rspec3' else - fail 'requires rspec version 2, 3, or 4' + raise 'requires rspec version 2, 3, or 4' end module TestQueue class Runner class RSpec < Runner @@ -21,18 +23,26 @@ rspec = ::RSpec::Core::QueueRunner.new rspec.run_each(iterator).to_i end def summarize_worker(worker) - worker.summary = worker.lines.grep(/ examples?, /).first + worker.summary = worker.lines.grep(/ examples?, /).first worker.failure_output = worker.output[/^Failures:\n\n(.*)\n^Finished/m, 1] end end end class TestFramework class RSpec < TestFramework + begin + require 'turnip/rspec' + + include Turnip::RSpec::Loader + rescue LoadError + # noop + end + def all_suite_files options = ::RSpec::Core::ConfigurationOptions.new(ARGV) options.parse_options if options.respond_to?(:parse_options) options.configure(::RSpec.configuration) @@ -75,9 +85,10 @@ queue end def split_groups? return @split_groups if defined?(@split_groups) + @split_groups = ENV['TEST_QUEUE_SPLIT_GROUPS'] && ENV['TEST_QUEUE_SPLIT_GROUPS'].strip.downcase == 'true' end end end end