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.’
Rake::TestTask.new(:test) do |t|

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

end

Nice and easy again.

Advertisements

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:

WordPress.com Logo

You are commenting using your WordPress.com 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