forked from bikeindex/bike_index
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Guardfile_parallel
49 lines (41 loc) · 1.92 KB
/
Guardfile_parallel
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
directories %w(app spec lib config)
group :red_green_refactor, halt_on_fail: true do
rspec_options = {
cmd: "bin/parallel_rspec --test-options='-f documentation -o /dev/null -f progress",
cmd_additional_args: "--require rails_helper --no-profile --order defined'",
run_all: {
cmd: "bin/parallel_rspec --quiet --test-options='-f documentation -o /dev/null -f progress",
cmd_additional_args: "'",
},
failed_mode: :focus,
all_after_pass: false,
}
guard :rspec, rspec_options do
watch(%r{^spec/.+_spec\.rb$})
watch(%r{^lib/(.+)\.rb$}) { |m| "spec/lib/#{m[1]}_spec.rb" }
watch(%r{^config/initializers/(.+)\.rb$}) { |m| "spec/initializers/#{m[1]}_spec.rb" }
watch(%r{^spec/(spec|rails)_helper\.rb$}) { "spec" }
watch("config/routes.rb") { "spec/routing" }
# App files with typical parallel structure
watch(%r{^app/(.+)\.rb$}) { |m| "spec/#{m[1]}_spec.rb" }
watch(%r{^app/(.*)(\.erb|\.haml)$}) { |m| "spec/#{m[1]}#{m[2]}_spec.rb" }
# Special cases for controller and request specs
watch(%r{^app/controllers/(.+)_controller\.rb$}) { |m| "spec/requests/#{m[1]}_request_spec.rb" }
watch(%r{^app/controllers/api/(.+)\.rb$}) { |m| "spec/requests/api/#{m[1]}_spec.rb" }
# Base classes
# watch("app/controllers/application_controller.rb") { "spec/controllers" }
# watch("app/controllers/api/base.rb") { "spec/controllers/api" }
# watch("app/controllers/admin/base_controller.rb") { "spec/controllers/admin" }
# watch("app/decorators/application_decorator.rb") { "spec/decorators" }
# watch("app/decorators/application_helper.rb") { "spec/helpers" }
end
guard :rubocop, all_on_start: false do
watch(%r{^app/(.+)\.rb$})
watch(%r{^spec/(.+)\.rb$})
watch(%r{^config/(.+)\.rb$})
watch(%r{^lib/(.+)\.rb$})
watch(%r{^lib/(.+)\.rake$})
watch(%r{^db/(.+)\.rb$})
watch(%r{(?:.+/)?\.rubocop\.yml$}) { |m| File.dirname(m[0]) }
end
end