Skip to content
Browse files

add quard gem for development

Run it with bundle exec guard and see tests automatically run, when
something has been changed on your files.
  • Loading branch information...
1 parent f5b7b8a commit df1ddfc259547ea9175e01d4120add6d7345b360 @johnyb johnyb committed Mar 6, 2012
Showing with 55 additions and 1 deletion.
  1. +3 −0 Gemfile
  2. +15 −1 Gemfile.lock
  3. +37 −0 Guardfile
View
3 Gemfile
@@ -24,8 +24,11 @@ gem 'rdiscount'
gem 'rdoc', "< 3.10"
group :development, :test do
+ gem 'guard-rspec'
gem 'rspec-rails'
+ gem 'guard-cucumber'
gem 'cucumber-rails'
gem 'database_cleaner'
+ gem 'guard-spork'
gem 'spork'
end
View
16 Gemfile.lock
@@ -85,7 +85,18 @@ GEM
grit (2.4.1)
diff-lcs (~> 1.1)
mime-types (~> 1.15)
- haml (3.1.3)
+ guard (1.0.0)
+ ffi (>= 0.5.0)
+ thor (~> 0.14.6)
+ guard-cucumber (0.7.5)
+ cucumber (>= 0.10)
+ guard (>= 0.8.3)
+ guard-rspec (0.6.0)
+ guard (>= 0.10.0)
+ guard-spork (0.5.2)
+ guard (>= 0.10.0)
+ spork (>= 0.8.4)
+ haml (3.1.4)
hike (1.2.1)
i18n (0.6.0)
jquery-rails (1.0.18)
@@ -202,6 +213,9 @@ DEPENDENCIES
devise
devise_ldap_authenticatable
gollum
+ guard-cucumber
+ guard-rspec
+ guard-spork
haml
jquery-rails
json
View
37 Guardfile
@@ -0,0 +1,37 @@
+# A sample Guardfile
+# More info at https://github.com/guard/guard#readme
+
+guard 'cucumber' do
+ watch(%r{^features/.+\.feature$})
+ watch(%r{^features/support/.+$}) { 'features' }
+ watch(%r{^features/step_definitions/(.+)_steps\.rb$}) { |m| Dir[File.join("**/#{m[1]}.feature")][0] || 'features' }
+end
+
+guard 'spork', :cucumber_env => { 'RAILS_ENV' => 'test' }, :rspec_env => { 'RAILS_ENV' => 'test' }, :wait => 60 do
+ watch('config/application.rb')
+ watch('config/environment.rb')
+ watch(%r{^config/environments/.+\.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
+
+guard 'rspec', :version => 2 do
+ watch(%r{^spec/.+_spec\.rb$})
+ watch(%r{^lib/(.+)\.rb$}) { |m| "spec/lib/#{m[1]}_spec.rb" }
+ watch('spec/spec_helper.rb') { "spec" }
+
+ # Rails example
+ watch(%r{^app/(.+)\.rb$}) { |m| "spec/#{m[1]}_spec.rb" }
+ watch(%r{^app/(.*)(\.erb|\.haml)$}) { |m| "spec/#{m[1]}#{m[2]}_spec.rb" }
+ 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"] }
+ watch(%r{^spec/support/(.+)\.rb$}) { "spec" }
+ watch('config/routes.rb') { "spec/routing" }
+ watch('app/controllers/application_controller.rb') { "spec/controllers" }
+ # Capybara request specs
+ watch(%r{^app/views/(.+)/.*\.(erb|haml)$}) { |m| "spec/requests/#{m[1]}_spec.rb" }
+end
+

0 comments on commit df1ddfc

Please sign in to comment.
Something went wrong with that request. Please try again.