Created
October 5, 2012 18:45
-
-
Save fgrehm/3841631 to your computer and use it in GitHub Desktop.
guard-rspec with acceptance and unit tests split up
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
guard 'rspec', :version => 2, :spec_paths => ["spec/models", 'spec/controllers'] do | |
watch(%r{^spec/(models|controllers).+_spec\.rb$}) | |
watch(%r{^lib/(.+)\.rb$}) { |m| "spec/lib/#{m[1]}_spec.rb" } | |
watch('spec/spec_helper.rb') { ["spec/controllers", 'spec/models'] } | |
watch('spec/factories/*.rb') { ["spec/controllers", 'spec/models'] } | |
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/models", 'spec/controllers'] } | |
watch('app/controllers/application_controller.rb') { "spec/controllers" } | |
# TODO: Find a way to trigger acceptance specs from here only when specs are all green | |
# callback(:run_all_end) { `find spec/acceptance/ -iname *_spec.rb | xargs -n1 touch` } | |
end | |
guard 'rspec', :version => 2, :spec_paths => "spec/acceptance", :all_after_pass => false do | |
watch(%r{^spec/acceptance/(.+)_spec\.rb$}) { |m| "spec/acceptance/#{m[1]}_spec.rb" } | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment