From de7ce04615de527a49c9409aaa3fdaabb100f695 Mon Sep 17 00:00:00 2001 From: Mark Moser Date: Tue, 16 Aug 2016 12:08:42 -0500 Subject: [PATCH] added watch task for erb files --- Guardfile | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Guardfile b/Guardfile index b58c512..5f22305 100644 --- a/Guardfile +++ b/Guardfile @@ -25,6 +25,11 @@ guard :minitest, spring: "bin/rails test", all_after_pass: true, all_on_start: f # run tests when touching files matching: /lib/**/*.rb watch(%r{^lib/(.*/)?([^/]+)\.rb$}) { |m| ["test/lib/#{m[1]}#{m[2]}_test.rb", "test/lib/#{m[1]}#{m[2]}"] } + # run controller/integration test when touching erb files + watch(%r{^app/views/((?!_mailer).)*([^/]+)\.erb$}) { ["test/controllers", "test/integration"] } + + # run mailers/integration test when touching mailer erb files + watch(%r{^app/views/(.*_mailer/)?([^/]+)\.erb$}) { ["test/mailers", "test/integration"] } end guard 'livereload' do