guard / guard-rspec

Guard::RSpec automatically run your specs (much like autotest)

Home Page:https://rubygems.org/gems/guard-rspec

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

specs are not run in parallel when spec_helper changes

opened this issue · comments

With this guardfile

rspec_options = {
  all_on_start: true,
  cmd: 'bundle exec rspec',
  failed_mode: :keep,
  run_all: {
    cmd: "bundle exec parallel_rspec -o '",
    cmd_additional_args: "'"
  }
}

guard :rspec, rspec_options do
  watch %r{^spec/.+_spec\.rb$}
  watch(%r{^spec/.*_helper.rb$}) { 'spec' }
end

When I run $ touch spec/spec_helper, I expect all of my tests to run in parallel. What actually happens is that they run serially.

My tests are run in parallel when guard starts initially, so the run_all options appear to be working.

I think it should be:

rspec_options = {
  all_on_start: true,
  cmd: "bundle exec parallel_rspec -o '",
  cmd_additional_args: "'"
  failed_mode: :keep,
  run_all: {
    cmd: "bundle exec parallel_rspec -o '",
    cmd_additional_args: "'"
  }
}

guard :rspec, rspec_options do
  watch %r{^spec/.+_spec\.rb$}
  watch(%r{^spec/.*_helper.rb$}) { 'spec' }
end

(instead of just for the run_all: option)