Adding tests to rake

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.’ do |t|

t.pattern = ‘lib/**/test/*_test.rb’
t.verbose = true


Nice and easy again.


Leave a comment

Filed under rails, Ruby, Test Driven Development (TDD)

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s