# A sample Guardfile # More info at https://github.com/guard/guard#readme guard :test do watch(%r{^lib/(.+)\.rb$}) { |m| "test/#{m[1]}_test.rb" } watch(%r{^test/.+_test\.rb$}) watch('test/test_helper.rb') { "test" } watch(%r{/test\/unit\/(.+)_test.rb/}) watch('../lib/dailycred/acts_as_dailycred.rb') { "test/unit/user_test.rb"} Dir[File.expand_path('../../lib/dailycred/*.rb', __FILE__)].each do |f| watch(f) {"test/unit/user_test.rb"} end # Rails example watch(%r{^app/models/(.+)\.rb$}) { |m| "test/unit/#{m[1]}_test.rb" } watch(%r{^app/controllers/(.+)\.rb$}) { |m| "test/functional/#{m[1]}_test.rb" } watch(%r{^app/views/.+\.rb$}) { "test/integration" } watch('app/controllers/application_controller.rb') { ["test/functional", "test/integration"] } end guard 'spork', :cucumber_env => { 'RAILS_ENV' => 'test' }, :rspec_env => { 'RAILS_ENV' => 'test' } do watch('config/application.rb') watch('config/environment.rb') watch('config/environments/test.rb') watch(%r{^config/initializers/.+\.rb$}) watch('Gemfile') watch('Gemfile.lock') watch('spec/spec_helper.rb') { :rspec } watch('test/test_helper.rb') { :test_unit } watch(%r{features/support/}) { :cucumber } end