File: Guardfile

package info (click to toggle)
ruby-listen 3.9.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, trixie
  • size: 544 kB
  • sloc: ruby: 5,033; makefile: 9
file content (26 lines) | stat: -rw-r--r-- 1,064 bytes parent folder | download | duplicates (6)
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
ignore(%r{spec/\.fixtures/})

group :specs, halt_on_fail: true do
  guard :rspec, cmd: 'bundle exec rspec -t ~acceptance', failed_mode: :keep, all_after_pass: true do
    watch(%r{^spec/lib/.+_spec\.rb$})
    watch(%r{^lib/(.+)\.rb$})     { |m| "spec/lib/#{m[1]}_spec.rb" }
    watch(%r{^spec/support/*})    { 'spec' }
    watch('spec/spec_helper.rb')  { 'spec' }
  end

  guard :rubocop, all_on_start: false, cli: '--rails' do
    watch(%r{.+\.rb$}) { |m| m[0] }
    watch(%r{(?:.+/)?\.rubocop\.yml$}) { |m| File.dirname(m[0]) }
    watch(%r{(?:.+/)?\.rubocop_todo\.yml$}) { |m| File.dirname(m[0]) }
  end

  # TODO: guard rspec should have a configurable file for this to work
  # TODO: also split up Rakefile
  guard :rspec, cmd: 'bundle exec rspec -t acceptance', failed_mode: :keep, all_after_pass: true do
    watch(%r{^spec/lib/.+_spec\.rb$})
    watch(%r{^lib/(.+)\.rb$})     { |m| "spec/lib/#{m[1]}_spec.rb" }
    watch(%r{^spec/support/*})    { 'spec' }
    watch('spec/spec_helper.rb')  { 'spec' }
    watch(%r{^spec/acceptance/.+_spec\.rb$})
  end
end