Bundle and use guard to automatically run specs on FS events

This commit is contained in:
Thibault Jouan 2011-09-06 13:39:23 +00:00
parent 7350c1e17d
commit 4a11073106
3 changed files with 39 additions and 0 deletions

View File

@ -15,4 +15,8 @@ group :development, :test do
gem 'database_cleaner'
gem 'factory_girl_rails'
gem 'spork', '~> 0.9.0.rc'
gem 'guard'
gem 'guard-rspec'
gem 'guard-spork'
gem 'rb-inotify'
end

View File

@ -61,6 +61,13 @@ GEM
ffi (1.0.9)
gherkin (2.4.1)
json (>= 1.4.6)
guard (0.6.3)
thor (~> 0.14.6)
guard-rspec (0.4.4)
guard (>= 0.4.0)
guard-spork (0.2.1)
guard (>= 0.2.2)
spork (>= 0.8.4)
haml (3.1.2)
i18n (0.5.0)
json (1.5.3)
@ -93,6 +100,8 @@ GEM
rdoc (~> 3.4)
thor (~> 0.14.4)
rake (0.9.2)
rb-inotify (0.8.6)
ffi (>= 0.5.0)
rdoc (3.8)
rspec (2.6.0)
rspec-core (~> 2.6.0)
@ -132,8 +141,12 @@ DEPENDENCIES
cucumber-rails
database_cleaner
factory_girl_rails
guard
guard-rspec
guard-spork
haml
rails (= 3.0.9)
rb-inotify
rspec-rails
spork (~> 0.9.0.rc)
sqlite3

22
Guardfile Normal file
View File

@ -0,0 +1,22 @@
guard 'spork', :cucumber => false, :rspec_env => { 'RAILS_ENV' => 'test' } do
watch('config/application.rb')
watch('config/environment.rb')
watch(%r{^config/environments/.+\.rb$})
watch(%r{^config/initializers/.+\.rb$})
watch('spec/spec_helper.rb')
watch(%r{^spec/support/.+\.rb$})
end
guard 'rspec', :cli => '--drb', :notification => false do
watch(%r{^spec/.+_spec\.rb$})
watch('spec/spec_helper.rb') { 'spec' }
watch(%r{^spec/support/.+\.rb$}) { 'spec' }
watch('spec/factories.rb') { 'spec' }
watch(%r{^app/(.+)\.rb$}) { |m| "spec/#{m[1]}_spec.rb" }
watch(%r{^app/(.+)\.haml$}) { |m| "spec/#{m[1]}.haml_spec.rb" }
watch(%r{^lib/(.+)\.rb$}) { |m| "spec/lib/#{m[1]}_spec.rb" }
watch('app/controllers/application_controller.rb') { 'spec/controllers' }
end