-
Notifications
You must be signed in to change notification settings - Fork 8
/
Guardfile
38 lines (29 loc) · 1.1 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
# Eaco's Guardfile
#
unless ENV['BUNDLE_GEMFILE'] =~ %r{gemfiles/rails}
abort 'specs and features require appraisal. Try `appraisal rails-4.2 guard`'
end
# Watch lib/ and spec/
directories %w(lib spec features)
# Clear the screen before every task
clearing :on
guard :rspec, version: 3, cmd: 'bundle exec rspec' do
# When single specs change, run them.
watch(%r{^spec/.+_spec\.rb$})
# When spec_helper changes rerun all the specs.
watch('spec/spec_helper.rb') { "spec" }
# When a source changes run its unit spec.
watch(%r{^lib/(.+)\.rb$}) {|m| "spec/#{m[1]}_spec.rb" }
end
guard :cucumber do
# When single features change, run them.
watch(%r{^features/.+\.feature$})
# When support code changes, rerun all features.
watch(%r{^features/support/.+$}) { 'features' }
# When a step definition for a feature changes, rerun the corresponding feature.
watch(%r{^features/step_definitions/(.+)_steps\.rb$}) { |m| Dir[File.join("**/#{m[1]}.feature")][0] || 'features' }
end
guard :shell do
# Rerun scenarios when source code changes
watch(%r{^lib/.+\.rb$}) { system 'cucumber -f progress' }
end