-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathGuardfile
31 lines (24 loc) · 1.04 KB
/
Guardfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
# Guardfile
guard :minitest do
# Run everything within 'test' if the test helper changes
watch(%r{^test/test_helper\.rb$}) { 'test' }
# Run everything within 'test/system' if ApplicationSystemTestCase changes
watch(%r{^test/application_system_test_case\.rb$}) { 'test/system' }
# Run the corresponding test anytime something within 'app' changes
# e.g. 'app/models/example.rb' => 'test/models/example_test.rb'
watch(%r{^app/(.+)\.rb$}) { |m| "test/#{m[1]}_test.rb" }
# Run a test any time it changes
watch(%r{^test/.+_test\.rb$})
# Run everything in or below 'test/controllers' everytime ApplicationController changes
watch(%r{^app/controllers/application_controller\.rb$}) do
'test/controllers'
end
# Run integration test every time a corresponding controller changes
# watch(%r{^app/controllers/(.+)_controller\.rb$}) do |m|
# "test/integration/#{m[1]}_test.rb"
# end
# Run mailer tests when mailer views change
# watch(%r{^app/views/(.+)_mailer/.+}) do |m|
# "test/mailers/#{m[1]}_mailer_test.rb"
# end
end