-
Notifications
You must be signed in to change notification settings - Fork 100
/
Guardfile
37 lines (35 loc) · 1.71 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
# frozen_string_literal: true
guard :rspec, cmd: 'bundle exec rspec' do
watch('spec/spec_helper.rb') { 'spec' }
watch('config/routes.rb') { 'spec/routing' }
watch('app/controllers/application_controller.rb') { 'spec/requests' }
watch('app/services/integrations/aggregator/invoices/payloads/base_payload.rb') do
'spec/services/integrations/aggregator/invoices/payloads'
end
watch('app/services/integrations/aggregator/credit_notes/payloads/base_payload.rb') do
'spec/services/integrations/aggregator/credit_notes/payloads'
end
watch('app/services/integrations/aggregator/contacts/payloads/base_payload.rb') do
'spec/services/integrations/aggregator/contacts/payloads'
end
watch('app/services/integrations/aggregator/payments/payloads/base_payload.rb') do
'spec/services/integrations/aggregator/payments/payloads'
end
watch('app/services/integrations/aggregator/base_service.rb') { 'spec/services/integrations/aggregator/' }
watch('app/services/base_service.rb') { 'spec/services/' }
watch('app/jobs/application_job.rb') { 'spec/jobs/' }
watch('app/models/application_record.rb') { 'spec/models/' }
watch('app/serializers/model_serializer.rb') { 'spec/serializers/' }
watch('app/graphql/lago_api_schema.rb') { 'spec/graphql/' }
watch(%r{^spec/.+_spec\.rb$})
watch(%r{^app/(.+)\.rb$}) { |m| "spec/#{m[1]}_spec.rb" }
watch(%r{^lib/(.+)\.rb$}) { |m| "spec/lib/#{m[1]}_spec.rb" }
watch(%r{^app/controllers/(.+)_(controller)\.rb$}) do |m|
[
"spec/#{m[2]}s/#{m[1]}_#{m[2]}_spec.rb",
"spec/requests/#{m[1]}_controller_spec.rb"
]
end
# Run schema check for any change in Graphql folder
watch(%r{^app/graphql/(.+)\.rb$}) { |m| "spec/graphql/lago_api_schema_spec.rb" }
end