~tim/scheme-vm

fd1db0d52ebb2cec81ffa704a927dd715f8dad97 — Tim Morgan 2 years ago 6eae1b8
Focus lib specs also
1 files changed, 7 insertions(+), 0 deletions(-)

M .watchr
M .watchr => .watchr +7 -0
@@ 23,12 23,19 @@ def compile
end

def focused_tests
  return ['spec/lib_spec.rb'] if focused_lib_spec.any?
  Dir['spec/**/*_spec.rb'].to_a.select do |path|
    !path.end_with?('lib_spec.rb') && \
      File.read(path).match(/focus:|fdescribe|fcontext|fit ['"]/) rescue nil
  end
end

def focused_lib_spec
  Dir['spec/lib/*.scm'].to_a.select do |path|
    File.read(path).match(/;; focus/)
  end
end

watch('^spec/.*_spec\.rb')  { |m| run_tests(m.to_s) }
watch('^spec/.*-spec\.scm') { |m| run_tests('spec/lib_spec.rb', m.to_s) }
watch('^lib')               { |m| run_tests('spec/lib_spec.rb') }