Permalink
Browse files

Add guard-rspec for automated testing

Conflicts:

	Gemfile
  • Loading branch information...
1 parent 666a77d commit 754df4fb60e7c00ba4dada7ca7b446548ccc8662 @jcf jcf committed May 18, 2011
Showing with 25 additions and 3 deletions.
  1. +8 −3 Gemfile
  2. +17 −0 Guardfile
View
11 Gemfile
@@ -1,7 +1,12 @@
source 'http://rubygems.org/'
-platforms :jruby do
- gem 'jruby-openssl', '~> 0.7'
+gemspec
+
+group :development do
+ gem 'guard-rspec'
+ gem 'rb-fsevent'
end
-gemspec
+platforms :jruby do
+ gem 'jruby-openssl', '~> 0.7'
+end
View
@@ -0,0 +1,17 @@
+# A sample Guardfile
+# More info at https://github.com/guard/guard#readme
+
+guard 'rspec', :cli => '--color', :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('spec/spec_helper.rb') { "spec" }
+ watch('config/routes.rb') { "spec/routing" }
+ watch('app/controllers/application_controller.rb') { "spec/controllers" }
+ watch(%r{^spec/.+_spec\.rb})
+ watch(%r{^app/(.+)\.rb}) { |m| "spec/#{m[1]}_spec.rb" }
+ watch(%r{^lib/(.+)\.rb}) { |m| "spec/lib/#{m[1]}_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"] }
+end

0 comments on commit 754df4f

Please sign in to comment.