-
Notifications
You must be signed in to change notification settings - Fork 10
/
Guardfile
89 lines (80 loc) · 2.19 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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
# encoding: UTF-8
# -*- mode: ruby -*-
# vi: set ft=ruby :
# More info at https://github.com/guard/guard#readme
# Style Tests
# ===========
# - Foodcritic
# - RuboCop
group :style,
halt_on_fail: true do
guard :foodcritic,
cli: '--exclude test/unit',
cookbook_paths: '.',
all_on_start: false do
watch(%r{attributes/.+\.rb$})
watch(%r{definitions/.+\.rb$})
watch(%r{libraries/.+\.rb$})
watch(%r{providers/.+\.rb$})
watch(%r{recipes/.+\.rb$})
watch(%r{resources/.+\.rb$})
watch(%r{templates/.+\.erb$})
watch('metadata.rb')
end
guard :rubocop,
all_on_start: false do
watch(/.+\.rb$/)
watch('Gemfile')
watch('Rakefile')
watch('Capfile')
watch('Guardfile')
watch('Podfile')
watch('Thorfile')
watch('Vagrantfile')
watch('Berksfile')
watch('Cheffile')
watch('Vagabondfile')
end
end # group style
# Unit Tests
# ==========
# - test/unit/libraries/${library}_spec.rb: Unit tests for libraries.
# - test/unit/recipes/${recipe}_spec.rb: ChefSpec tests for recipes.
# - test/unit/resources/${resource}_spec.rb: ChefSpec tests for resources.
group :unit do
guard :rspec,
cmd: 'bundle exec rake unit',
all_on_start: false do
watch(%r{^libraries/(.+)\.rb$}) do |m|
"test/unit/libraries/#{m[1]}_spec.rb"
end
watch(%r{^recipes/(.+)\.rb$}) { |m| "test/unit/recipes/#{m[1]}_spec.rb" }
watch(%r{^(?:providers|resources)/(.+)\.rb$}) do |m|
"test/unit/resources/#{m[1]}_spec.rb"
end
watch(%r{^test/unit/.+_spec\.rb$})
watch('test/unit/spec_helper.rb') { 'spec' }
end
end # group unit
# Integration Tests
# =================
# - test-kitchen
#
# Temporary disabled. See the Gemfile.
# group :integration do
# guard 'kitchen',
# all_on_start: false do
# watch(%r{attributes/.+\.rb$})
# watch(%r{definitions/.+\.rb$})
# watch(%r{libraries/.+\.rb$})
# watch(%r{providers/.+\.rb$})
# watch(%r{recipes/.+\.rb$})
# watch(%r{resources/.+\.rb$})
# watch(%r{files/.+})
# watch(%r{templates/.+\.erb$})
# watch('metadata.rb')
# watch(%r{test/.+$})
# watch('Berksfile')
# end
# end # group integration
scope groups: [:style, :unit]