-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathGuardfile
executable file
·41 lines (28 loc) · 1.14 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
33
34
35
36
37
38
39
40
# A sample Guardfile
# More info at https://github.com/guard/guard#readme
guard 'rspec', :version => 2, :cli => '--drb' do
=begin
watch(%r{^spec/.+_spec\.rb$})
watch('spec/spec_helper.rb') { "spec" }
# Rails example
# too generic
#watch(%r{^app/(.*)(\.erb|\.haml)$}) { |m| "spec/#{m[1]}#{m[2]}_spec.rb" }
# not used
#watch(%r{^spec/support/(.+)\.rb$}) { "spec" }
#watch(%r{^lib/(.+)\.rb$}) { |m| "spec/lib/#{m[1]}_spec.rb" }
# routes
watch('config/routes.rb') { "spec/routing" }
watch(%r{^spec/routing/(.+)_routing\.rb$}) { |m| "spec/routing/#{m[1]}_routing_spec.rb" }
# models
watch(%r{^app/models/(.+)\.rb$}) { |m| "spec/models/#{m[1]}_spec.rb" }
=end
watch(%r{^app/(.+)\.rb$}) { |m| "spec/#{m[1]}_spec.rb" }
# controllers
watch(%r{^app/controllers/(.+)_controller\.rb$}) { |m| "spec/#{m[1]}_controller_spec.rb" }
#requests
watch(%r{^spec/requests/(.+)_spec\.rb$}) { |m| ["spec/requests/#{m[1]}_spec.rb"] }
=begin
#views
watch(%r{^app/views/(.+)/.*\.(erb|haml)$}) { |m| ["spec/views/#{m[1]}_spec.rb"] }
=end
end