Skip to content

Commit

Permalink
Adjusted watchr file so that I can flip on focused testing really eas…
Browse files Browse the repository at this point in the history
…ily.
  • Loading branch information
jnunemaker committed Dec 31, 2009
1 parent ccf73a9 commit cebc0bf
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions specs.watchr
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,16 @@ def related_test_files(path)
Dir['test/**/*.rb'].select { |file| file =~ /test_#{File.basename(path)}/ }
end

watch('test/test_helper\.rb') { run_all_tests }
watch('test/.*/test_.*\.rb') { |m| run_test_file(m[0]) }
watch('lib/.*') do |m|
related_test_files(m[0]).each { |file| run_test_file(file) }
if false
# for focusing on a particular test no matter what
watch('.*') do |m|
system('clear')
run_test_file('test/functional/test_modifiers.rb')
end
else
watch('test/test_helper\.rb') { run_all_tests }
watch('test/.*/test_.*\.rb') { |m| run_test_file(m[0]) }
watch('lib/.*') { |m| related_test_files(m[0]).each { |file| run_test_file(file) } }
end

# Ctrl-\
Expand Down

0 comments on commit cebc0bf

Please sign in to comment.