Skip to content

Commit

Permalink
Fixed Guard support
Browse files Browse the repository at this point in the history
  • Loading branch information
sman591 committed Jan 26, 2017
1 parent 04fc0ec commit e00c735
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 11 deletions.
2 changes: 1 addition & 1 deletion Gemfile
Expand Up @@ -51,8 +51,8 @@ gem 'dotenv-rails', groups: [:development, :test]
group :development do
gem 'better_errors'
gem 'binding_of_caller'
gem 'guard-minitest'
gem 'guard'
gem 'guard-minitest'
gem 'simplecov', require: false
end

Expand Down
19 changes: 9 additions & 10 deletions Guardfile
@@ -1,14 +1,13 @@
# More info at https://github.com/guard/guard#readme

guard :minitest, all_on_start: false, all_after_pass: false do
guard :minitest, all_on_start: false, all_after_pass: false, spring: "bin/rails test" do
watch(%r{^app/(?:models|presenters|validators|lib)/(.+)\.rb$}) { |m| "test/models/#{m[1]}_test.rb" }
watch(%r{^app/helpers/(.+)\.rb$}) { |m| "test/models/helpers/#{m[1]}_test.rb" }
watch(%r{^app/mailers/(.+)\.rb$}) { |m| "test/controllers/#{m[1]}_test.rb" }
watch(%r{^app/controllers/(?:([^\/]+/))?(.+)\.rb$}) { |m| "test/controllers/#{m[1..2].join}_test.rb" }
watch(%r{^app/views/(?:([^\/]+/))?([^\/]+)/.+$}) { |m| "test/controllers/#{m[1..2].join}_controller_test.rb" }
watch(%r{^app/views/layouts/.+$}) { "test/controllers" }
watch(%r{^app/views/.+\.rb$}) { "test/integration" }
watch(%r{^app/helpers/(.+)\.rb$}) { |m| "test/models/helpers/#{m[1]}_test.rb" }
watch(%r{^app/mailers/(.+)\.rb$}) { |m| "test/controllers/#{m[1]}_test.rb" }
watch(%r{^app/controllers/(.+)\.rb$}) { |m| "test/controllers/#{m[1]}_test.rb" }
watch(%r{^app/views/(.+)\/.+$}) { |m| "test/controllers/#{m[1]}_controller_test.rb" }
watch(%r{^app/views/layouts/.+$}) { "test/controllers" }
watch(%r{^app/views/.+\.rb$}) { "test/integration" }
watch(%r{^test/.+_test.rb$})
watch('app/controllers/application_controller.rb') { ["test/controllers", "test/integration"] }
watch('test/test_helper.rb') { "test" }
watch('app/controllers/application_controller.rb') { ["test/controllers", "test/integration"] }
watch('test/test_helper.rb') { "test" }
end

0 comments on commit e00c735

Please sign in to comment.