1- # A sample Guardfile
2- # More info at https://github.com/guard/guard#readme
3-
4- guard :rspec 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{^app/(.+)\. rb$} ) { |m | "spec/#{ m [ 1 ] } _spec.rb" }
11- watch ( %r{^app/(.*)(\. erb|\. haml|\. slim)$} ) { |m | "spec/#{ m [ 1 ] } #{ m [ 2 ] } _spec.rb" }
12- watch ( %r{^app/controllers/(.+)_(controller)\. rb$} ) { |m | [ "spec/routing/#{ m [ 1 ] } _routing_spec.rb" , "spec/#{ m [ 2 ] } s/#{ m [ 1 ] } _#{ m [ 2 ] } _spec.rb" , "spec/acceptance/#{ m [ 1 ] } _spec.rb" ] }
13- watch ( %r{^spec/support/(.+)\. rb$} ) { "spec" }
14- watch ( 'config/routes.rb' ) { "spec/routing" }
15- watch ( 'app/controllers/application_controller.rb' ) { "spec/controllers" }
16-
17- # Capybara features specs
18- watch ( %r{^app/views/(.+)/.*\. (erb|haml|slim)$} ) { |m | "spec/features/#{ m [ 1 ] } _spec.rb" }
19-
20- # Turnip features and steps
21- watch ( %r{^spec/acceptance/(.+)\. feature$} )
22- watch ( %r{^spec/acceptance/steps/(.+)_steps\. rb$} ) { |m | Dir [ File . join ( "**/#{ m [ 1 ] } .feature" ) ] [ 0 ] || 'spec/acceptance' }
23- end
241
252
26- guard :rspec do
3+ # Note: The cmd option is now required due to the increasing number of ways
4+ # rspec may be run, below are examples of the most common uses.
5+ # * bundler: 'bundle exec rspec'
6+ # * bundler binstubs: 'bin/rspec'
7+ # * spring: 'bin/rsspec' (This will use spring if running and you have
8+ # installed the spring binstubs per the docs)
9+ # * zeus: 'zeus rspec' (requires the server to be started separetly)
10+ # * 'just' rspec: 'rspec'
11+ guard :rspec , cmd : 'bundle exec rspec' do
2712 watch ( %r{^spec/.+_spec\. rb$} )
2813 watch ( %r{^lib/(.+)\. rb$} ) { |m | "spec/lib/#{ m [ 1 ] } _spec.rb" }
2914 watch ( 'spec/spec_helper.rb' ) { "spec" }
@@ -35,6 +20,7 @@ guard :rspec do
3520 watch ( %r{^spec/support/(.+)\. rb$} ) { "spec" }
3621 watch ( 'config/routes.rb' ) { "spec/routing" }
3722 watch ( 'app/controllers/application_controller.rb' ) { "spec/controllers" }
23+ watch ( 'spec/rails_helper.rb' ) { "spec" }
3824
3925 # Capybara features specs
4026 watch ( %r{^app/views/(.+)/.*\. (erb|haml|slim)$} ) { |m | "spec/features/#{ m [ 1 ] } _spec.rb" }
0 commit comments