Advertisement
Guest User

Guardfile

a guest
Feb 14th, 2014
111
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Rails 1.67 KB | None | 0 0
  1. require 'active_support/inflector'
  2.  
  3. # A sample Guardfile
  4. # More info at https://github.com/guard/guard#readme
  5.  
  6. guard 'rspec', all_after_pass: false, cli: '--drb' do
  7.   watch(%r{^spec/.+_spec\.rb$})
  8.   watch(%r{^lib/(.+)\.rb$})     { |m| "spec/lib/#{m[1]}_spec.rb" }
  9.   watch('spec/spec_helper.rb')  { "spec" }
  10.  
  11.   # Rails example
  12.   watch(%r{^app/(.+)\.rb$})                           { |m| "spec/#{m[1]}_spec.rb" }
  13.   watch(%r{^app/(.*)(\.erb|\.haml)$})                 { |m| "spec/#{m[1]}#{m[2]}_spec.rb" }
  14.   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"] }
  15.   watch(%r{^spec/support/(.+)\.rb$})                  { "spec" }
  16.   watch('config/routes.rb')                           { "spec/routing" }
  17.   watch('app/controllers/application_controller.rb')  { "spec/controllers" }
  18.  
  19.   # Capybara features specs
  20.   watch(%r{^app/views/(.+)/.*\.(erb|haml)$})          { |m| "spec/features/#{m[1]}_spec.rb" }
  21.  
  22.   # Turnip features and steps
  23.   watch(%r{^spec/acceptance/(.+)\.feature$})
  24.   watch(%r{^spec/acceptance/steps/(.+)_steps\.rb$})   { |m| Dir[File.join("**/#{m[1]}.feature")][0] || 'spec/acceptance' }
  25. end
  26.  
  27. guard 'spork', :cucumber_env => { 'RAILS_ENV' => 'test' }, :rspec_env => { 'RAILS_ENV' => 'test' }, :test_unit => false do
  28.   watch('config/application.rb')
  29.   watch('config/environment.rb')
  30.   watch('config/environments/test.rb')
  31.   watch(%r{^config/initializers/.+\.rb$})
  32.   watch('Gemfile')
  33.   watch('Gemfile.lock')
  34.   watch('spec/spec_helper.rb') { :rspec }
  35.   watch('test/test_helper.rb') { :test_unit }
  36.   watch(%r{features/support/}) { :cucumber }
  37. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement