forked from Meet-Up/meetup-old-api
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Guardfile
32 lines (30 loc) · 1.02 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
32
require 'active_support/core_ext'
guard 'spork', rspec_env: { 'RAILS_ENV' => 'test' },
test_unit: false do
watch('config/application.rb')
watch('config/environment.rb')
watch(%r{^config/environments/.+\.rb$})
watch(%r{^config/initializers/.+\.rb$})
watch('Gemfile')
watch('Gemfile.lock')
watch('spec/spec_helper.rb')
watch('test/test_helper.rb')
watch('spec/support/')
end
guard 'rspec', all_after_pass: false, cli: '--drb' do
watch('config/routes.rb')
watch(%r{^app/controllers/(.+)_(controller)\.rb$}) do |m|
["spec/routing/#{m[1]}_routing_spec.rb",
"spec/#{m[2]}s/#{m[1]}_#{m[2]}_spec.rb",
"spec/acceptance/#{m[1]}_spec.rb",
"spec/requests/#{m[1]}_spec.rb",
"spec/requests/#{m[1].singularize}_pages_spec.rb"]
end
watch(%r{^app/models/(.+).rb$}) do |m|
["spec/models/#{m[1]}_spec.rb"]
end
watch(%r{^app/views/(.+)/}) do |m|
(m[1][/_pages/] ? "spec/requests/#{m[1]}_spec.rb" :
"spec/requests/#{m[1].singularize}_pages_spec.rb")
end
end