-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathGuardfile
58 lines (41 loc) · 2.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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
# encoding: utf-8
# vim:ft=ruby
guard 'pow' do
watch('.rvmrc')
watch('Gemfile.lock')
watch('config.ru')
watch('app.rb')
watch(%r{^lib/.*\.rb$})
watch(%r{^app/.*\.rb$})
watch(%w{^config/.*\.rb$})
end
guard 'compass', :configuration_file => 'spec/assets/compass-config.rb' do
watch(%r{^app/stylesheets/.+\.scss$})
end
guard 'coffeescript', :input => 'app/javascripts', :output => 'public/javascripts'
guard 'rspec', :version => 2, :cli => '--color --format nested --fail-fast', :all_on_start => false, :all_after_pass => false do
# Map any file under lib/sherlock to the matching spec under spec/
watch(%r{^lib/sherlock/(.+)\.rb$}) { |m| "spec/#{m[1]}_spec.rb" }
# Rerun the spec when any spec file changes.
watch(%r{^spec/.+_spec\.rb$})
# Rerun all tests when the spec helper changes.
watch('spec/spec_helper.rb') { 'spec' }
# Rerun all tests when a spec support file changes.
watch(%r{^spec/support/.+\.rb$}) { 'spec' }
# Rerun the snapshot parser spec when any agent data asset changes.
watch(%r{^spec/assets/agent-data/.+\.json$}) { 'spec/snapshot_parser_spec.rb' }
# Rerun the config spec when any configuration asset changes.
watch(%r{^spec/assets/config/.+\.json$}) { 'spec/config_spec.rb' }
# Rerun all tests when the Gemfile.lock file changes.
watch('Gemfile.lock') { 'spec' }
# Rerun request specs when any controller file changes.
watch(%r{^app/controllers/(.+)\.rb$}) { |m| "spec/requests/#{m[1]}_spec.rb" }
# Rerun all request tests when config.ru changes.
watch('config.ru') { 'spec/requests' }
# Rerun all request tests when app.rb changes.
watch('app.rb') { 'spec/requests' }
# Rerun all request tests when any sinatra-file changes.
watch(%r{^lib/sherlock/sinatra/}) { 'spec/requests' }
# Rerun request tests when a view changes.
watch(%r{^app/views/(.+)/}) { |m| "spec/requests/#{m[1]}_spec.rb" }
end