diff --git a/Gemfile b/Gemfile index 35fc0bc..f0a5684 100644 --- a/Gemfile +++ b/Gemfile @@ -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 diff --git a/Gemfile.lock b/Gemfile.lock index f860dc5..41bbf54 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -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 diff --git a/Guardfile b/Guardfile new file mode 100644 index 0000000..2114b46 --- /dev/null +++ b/Guardfile @@ -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