guard keeps running all specs.. ?

334 views
Skip to first unread message

patrick99e99

unread,
Apr 16, 2012, 6:16:35 PM4/16/12
to guard-dev
Hi,

It seems that after I launch guard, and it runs through all specs,
when I then edit a spec file, it will re-run all specs again instead
of just running the specs in that very file...

This is my guardfile:

1 # A sample Guardfile
2 # More info at https://github.com/guard/guard#readme
3
4 guard 'rspec', :version => 2 do
5 watch(%r{^spec/.+_spec\.rb$})
6 watch(%r{^lib/(.+)\.rb$}) { |m| "spec/lib/#{m[1]}_spec.rb" }
7 watch('spec/spec_helper.rb') { "spec" }
8
9 # Rails example
10 watch(%r{^spec/.+_spec\.rb$})
11 watch(%r{^app/(.+)\.rb$}) { |m| "spec/
#{m[1]}_spec.rb" }
12 watch(%r{^lib/(.+)\.rb$}) { |m| "spec/
lib/#{m[1]}_spec.rb" }
13 watch(%r{^app/controllers/(.+)_(controller)\.rb$}) { |m| ["spec/
routing/#{m[1]}_routing_spec.rb", "spec/#{m[2]}s/#{m[1]}
14 watch(%r{^spec/support/(.+)\.rb$}) { "spec" }
15 watch('spec/spec_helper.rb') { "spec" }
16 watch('config/routes.rb') { "spec/
routing" }
17 watch('app/controllers/application_controller.rb') { "spec/
controllers" }
18 # Capybara request specs
19 watch(%r{^app/views/(.+)/.*\.(erb|haml)$}) { |m| "spec/
requests/#{m[1]}_spec.rb" }
20 end

Michael Kessler

unread,
Apr 17, 2012, 3:08:48 AM4/17/12
to guar...@googlegroups.com
You may have to adapt the Guard matchers to your project. I suggest to comment all and start reading them one by one and see which matcher causes the misbehavior.

Nils Blum-Oeste

unread,
Jan 7, 2013, 5:25:38 AM1/7/13
to guar...@googlegroups.com
You may want to have a look at this parameter:
:all_after_pass => false     # run all specs after changed specs pass, default: true
Reply all
Reply to author
Forward
0 new messages