We’ve developed a few batch applications that live in the same directory structure as the Rails app they’re intimate with. So, the lib/foo/test/ contains some tests for the ‘foo’ batch app. lib/bar/test has the ones for ‘bar’ etc.
It was kind of annoying to have seperate rake files though – or worse to need to execute each of the batch unit tests seperately.
Since the number of tests required is quite small at this point – they all just live directly under the test dir (not broken out into unit, functional, etc)…
desc ‘Test the batch stuff.’
Rake::TestTask.new(:test) do |t|
t.pattern = ‘lib/**/test/*_test.rb’
t.verbose = true
Nice and easy again.