I'm sure there's probably a better way of doing this, but I've just hacked
together a simple patch for Rake which allows the following syntax...
Rake::TestTask.new(:units => "db:test:prepare") do |t|
t.libs << "test"
t.pattern = 'test/unit/**/*_test.rb'
t.verbose = true
t.on_result = lambda do |ok, status|
# do stuff here
end
end
The new bit is the "on_result" bit which allow you to specify a Proc to be
executed when the Ruby process executing the tests completes. The ok &
status parameters allow you to determine whether or not the tests have all
passed or not. The patch makes use of the fact that FileUtils#ruby and
FileUtils#sh allow you to pass in a block to be executed after the command
runs.
Would you be interested in the patch? If yes, is there somewhere to submit
it - the normal Tracker stuff on Rubyforge doesn't seem to be enabled for
Rake.
Or can someone tell me a better way?
Thanks.
--
James.
http://blog.floehopper.org
_______________________________________________
Rake-devel mailing list
[email protected]
http://rubyforge.org/mailman/listinfo/rake-devel