mirror of
https://github.com/internetee/registry.git
synced 2025-08-02 16:02:03 +02:00
Introduced guard
This commit is contained in:
parent
97843207a7
commit
2f94c0aa38
3 changed files with 92 additions and 0 deletions
43
Guardfile
Normal file
43
Guardfile
Normal file
|
@ -0,0 +1,43 @@
|
|||
# A sample Guardfile
|
||||
# More info at https://github.com/guard/guard#readme
|
||||
|
||||
# Note: The cmd option is now required due to the increasing number of ways
|
||||
# rspec may be run, below are examples of the most common uses.
|
||||
# * bundler: 'bundle exec rspec'
|
||||
# * bundler binstubs: 'bin/rspec'
|
||||
# * spring: 'bin/rsspec' (This will use spring if running and you have
|
||||
# installed the spring binstubs per the docs)
|
||||
# * zeus: 'zeus rspec' (requires the server to be started separetly)
|
||||
# * 'just' rspec: 'rspec'
|
||||
group :red_green_refactor, halt_on_fail:true do
|
||||
guard :rspec, cmd: 'bundle exec rspec' do
|
||||
watch(%r{^spec/.+_spec\.rb$})
|
||||
watch(%r{^lib/(.+)\.rb$}) { |m| "spec/lib/#{m[1]}_spec.rb" }
|
||||
watch('spec/spec_helper.rb') { "spec" }
|
||||
|
||||
# Rails example
|
||||
watch(%r{^app/(.+)\.rb$}) { |m| "spec/#{m[1]}_spec.rb" }
|
||||
watch(%r{^app/(.*)(\.erb|\.haml|\.slim)$}) { |m| "spec/#{m[1]}#{m[2]}_spec.rb" }
|
||||
watch(%r{^app/controllers/(.+)_(controller)\.rb$}) { |m| ["spec/routing/#{m[1]}_routing_spec.rb", "spec/#{m[2]}s/#{m[1]}_#{m[2]}_spec.rb", "spec/acceptance/#{m[1]}_spec.rb"] }
|
||||
watch(%r{^spec/support/(.+)\.rb$}) { "spec" }
|
||||
watch('config/routes.rb') { "spec/routing" }
|
||||
watch('app/controllers/application_controller.rb') { "spec/controllers" }
|
||||
watch('spec/rails_helper.rb') { "spec" }
|
||||
|
||||
# epp tests
|
||||
watch('app/helpers/epp/contacts_helper.rb') { 'spec/epp/contact_spec.rb' }
|
||||
watch('app/helpers/epp/domains_helper.rb') { 'spec/epp/domain_spec.rb' }
|
||||
# Capybara features specs
|
||||
watch(%r{^app/views/(.+)/.*\.(erb|haml|slim)$}) { |m| "spec/features/#{m[1]}_spec.rb" }
|
||||
|
||||
# Turnip features and steps
|
||||
watch(%r{^spec/acceptance/(.+)\.feature$})
|
||||
watch(%r{^spec/acceptance/steps/(.+)_steps\.rb$}) { |m| Dir[File.join("**/#{m[1]}.feature")][0] || 'spec/acceptance' }
|
||||
end
|
||||
|
||||
# Disabled rubocop in guard until old offenses are removed to reduce visual clutter
|
||||
# guard :rubocop do
|
||||
# watch(%r{.+\.rb$})
|
||||
# watch(%r{(?:.+/)?\.rubocop\.yml$}) { |m| File.dirname(m[0]) }
|
||||
# end
|
||||
end
|
Loading…
Add table
Add a link
Reference in a new issue