forked from department-of-veterans-affairs/vets-api
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Guardfile
27 lines (21 loc) · 904 Bytes
/
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
# frozen_string_literal: true
guard :rspec, cmd: 'DISABLE_SPRING=y NOCOVERAGE=y bin/rspec' do
require 'guard/rspec/dsl'
dsl = Guard::RSpec::Dsl.new(self)
watch(dsl.rspec.spec_helper) { dsl.rspec.spec_dir }
watch(dsl.rspec.spec_support) { dsl.rspec.spec_dir }
watch(dsl.rspec.spec_files)
dsl.watch_spec_files_for(dsl.ruby.lib_files)
dsl.watch_spec_files_for(dsl.rails.app_files)
watch(dsl.rails.controllers) do |m|
[dsl.rspec.spec.call("routing/#{m[1]}_routing"),
dsl.rspec.spec.call("controllers/#{m[1]}_controller")]
end
watch(dsl.rails.spec_helper) { rspec.spec_dir }
watch(dsl.rails.routes) { "#{rspec.spec_dir}/routing" }
watch(dsl.rails.app_controller) { "#{rspec.spec_dir}/controllers" }
end
guard :rubocop, all_on_start: false, cli: %w[--auto-correct --format fuubar] do
watch(/.+\.rb$/)
watch(%r{(?:.+/)?\.rubocop\.yml$}) { |m| File.dirname(m[0]) }
end