-
-
Notifications
You must be signed in to change notification settings - Fork 13
/
Guardfile
56 lines (47 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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
REEK_ARGS = %w[
--line-numbers
--color
--documentation
--progress
--single-line
--sort-by smelliness
].freeze
RUBOCOP_ARGS = %w[
-P
--format fuubar
].freeze
RSPEC_OPTIONS = {
cmd: "env COV=true bundle exec rspec",
# cmd_additional_args: "--format documentation",
failed_mode: :focus,
all_on_start: false
}
scope group: :tdd
clearing :on
group :tdd, halt_on_fail: true do
guard :rspec, RSPEC_OPTIONS do
require "guard/rspec/dsl"
dsl = Guard::RSpec::Dsl.new(self)
# RSpec files
rspec = dsl.rspec
watch(%r{^lib/(.+)\.rb$}) { |m| "spec/unit/#{m[1]}_spec.rb" }
watch(%r{^lib/(.+)\.rb$}) { |m| "spec/integration/#{m[1]}_spec.rb" }
watch(%r{^spec/support/workers/(.+)\.rb$}) { |m| "spec/workers/#{m[1]}_spec.rb" }
watch(rspec.spec_helper) { rspec.spec_dir }
watch(rspec.spec_support) { rspec.spec_dir }
watch(rspec.spec_files)
ruby = dsl.ruby
dsl.watch_spec_files_for(ruby.lib_files)
end
guard :rubocop, all_on_start: false, cli: RUBOCOP_ARGS do
watch(%r{.+\.rb$})
watch(%r{(?:.+/)?\.rubocop(?:_todo)?\.yml$}) { |m| File.dirname(m[0]) }
end
guard :reek, all_on_start: false, cli: REEK_ARGS do
watch(%r{.+\.rb$})
watch('.reek')
end
end
guard :bundler do
watch('Gemfile')
end