~tim/scheme-vm

046b6216c63e1f3eeec4662ea8a71d410603958f — Tim Morgan 3 years ago 2d99c05
Fix .watchr script focus test detection
1 files changed, 5 insertions(+), 2 deletions(-)

M .watchr
M .watchr => .watchr +5 -2
@@ 23,7 23,10 @@ def compile
end

def focused_tests
  Dir['spec/**/*_spec.rb'].to_a.select { |f| File.read(f).match(/focus|focus:|fdescribe|fcontext|fit ['"]/) rescue nil }
  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

watch('^spec/.*_spec\.rb')  { |m| run_tests(m.to_s) }


@@ 31,7 34,7 @@ watch('^spec/.*-spec\.scm') { |m| run_tests('spec/lib_spec.rb', m.to_s) }
watch('^lib')               { |m| run_tests('spec/lib_spec.rb') }
watch('^vm.*')              { |m| run_tests('spec/vm_spec.rb spec/vm/*') }
watch('^compiler.*')        { |m| run_tests('spec/compiler_spec.rb spec/compiler/*') }
watch('^program.*')         { |m| run_tests('spec/program_spec.rb spec/program/*') }
watch('^program.*')         { |m| run_tests('spec/program_spec.rb') }
watch('^parser.*')          { |m| run_tests('spec/parser_spec.rb') }
watch('^src/.*')            { compile }