Skip to content

Commit

Permalink
Configure guard-rspec
Browse files Browse the repository at this point in the history
  • Loading branch information
James Conroy-Finn committed May 18, 2011
1 parent 9cb57b3 commit 777fe7e
Showing 1 changed file with 17 additions and 10 deletions.
27 changes: 17 additions & 10 deletions Guardfile
@@ -1,17 +1,24 @@
# A sample Guardfile
# More info at https://github.com/guard/guard#readme

guard 'rspec', :cli => '--color', :version => 2 do
# rubies = %w[
# 1.8.6
# 1.8.7
# 1.9.2
# ree
# jruby
# ].map { |ruby| "#{ruby}@webmock" }

rspec_options = {
# :rvm => rubies,
:all_on_start => false,
:notification => false,
:cli => '--color',
:version => 2
}

guard 'rspec', rspec_options 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 777fe7e

Please sign in to comment.