Railsters:
Put this into a *.rake file, and invoke it from a command line as
“rake test:svn_recent”:
require ‘fileutils’
task ‘test:svn_recent’ do
svn status
.
split(“\n”).
map{|f| f =~ /^M\s+(.*_test.rb)/; $1 }.
compact.
each do |uncommitted|
FileUtils.touch uncommitted
end
Rake::Task[‘test:recent’].invoke
end
It finds every SVN file with a status of M (due to Subversion’s stated
goal to support absurdly easy grep-based scripting), and touches this
file. Then it invokes the normal test:recent run, which adds files to
the test list if their modification time is newer than 10 minutes ago.
For a good time, we could also add the ability to find every modified
source file, find its matching *_test.rb, and trigger it. That
behavior is allegedly in test:recent too, but I have never seen it
working. It should be very easy to add to this system.
–
Phlip
http://www.oreilly.com/catalog/9780596510657/
“Test Driven Ajax (on Rails)”
assert_xpath, assert_javascript, & assert_ajax