/
Guardfile
38 lines (27 loc) · 1.25 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
# ----------------------------------------------------------------------------------------------------------------------
# bundler
# ----------------------------------------------------------------------------------------------------------------------
guard 'bundler' do
watch('Gemfile')
end
# ----------------------------------------------------------------------------------------------------------------------
# spork (must be before rspec and cucumber)
# ----------------------------------------------------------------------------------------------------------------------
guard 'spork',
wait: 60 do
watch('Gemfile')
watch('Gemfile.lock')
# ----- spec directory
watch('spec/spec_helper.rb')
end
# ----------------------------------------------------------------------------------------------------------------------
# rspec
# ----------------------------------------------------------------------------------------------------------------------
guard :rspec, cmd: 'bundle exec rspec' do
# ----- lib directory
watch(%r{^lib/(.+)\.rb$}) { |m| %W(spec/#{m[1]}_spec.rb) }
watch(%r{^lib/(.+)\.(.+)\.erb$}) { |m| %W(spec/#{m[1]}_spec.rb) }
# ----- spec directory
watch(%r{^spec/.+_spec\.rb$})
watch(%r{^spec/support/(.+)\.rb$}) { %W(spec) }
end