-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathGuardfile
23 lines (19 loc) · 835 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
guard :rspec, cmd: 'bundle exec rspec' do
require 'guard/rspec/dsl'
dsl = Guard::RSpec::Dsl.new(self)
# RSpec files
rspec = dsl.rspec
watch(rspec.spec_helper) { rspec.spec_dir }
watch(rspec.spec_support) { rspec.spec_dir }
watch(rspec.spec_files)
# Ruby files
ruby = dsl.ruby
dsl.watch_spec_files_for(ruby.lib_files)
watch(%r{^lib/pinfluence/(.+)\.rb$}) { |m| "spec/pinfluence/#{m[1]}_spec.rb" }
watch(%r{^apps/(.+)/controllers/(.+)/(.+)\.rb$}) { |m| "spec/#{m[1]}/requests/" }
watch(%r{^apps/(.+)/controllers/(.+)/(.+)\.rb$}) { |m| "spec/#{m[1]}/features/" }
watch(%r{^apps/(.+)/views/(.+)/(.+)\.rb$}) { |m| "spec/#{m[1]}/requests/" }
watch(%r{^apps/(.+)/views/(.+)/(.+)\.rb$}) { |m| "spec/#{m[1]}/features/" }
# API
watch(%r{^apps/api/(schemas|types)/(.+)\.rb$}) { |_| 'spec/api/requests' }
end