views:

70

answers:

3

Hi all, I'm a recent convert to TDD but as my codebase grows in size and complexity, I find myself waiting longer and longer periods for the framework to load every time I want to run a test.

I am aware of rspec's spec_server but I'm using Test::Unit with shoulda. I tried Snailgun (http://github.com/candlerb/snailgun) but noticed very little increased in speed. I have also tried spork-testunit (http://github.com/timcharper/spork-testunit) but it's not fully compatible with my existing tests.

The delay in running tests is a definite pain point and is putting me off TDD (at least with Rails). Is anyone aware of any other options?

thanks Sam

+1  A: 

Are you using mocks where you need to?

You don't mention a mocking framework. Are you using one? Or are your tests large and do they test things like logging into web servers or running database queries?

I've heard a rule of thumb that unit tests should run about 100 per second, which precludes connecting to and using actual resources. Tests that access actual resources tend to be thought of as integration tests and they are understood to run slower than unit tests.

JeffH
I'll just add that Mocha is great for testing!
Marcos Placona
A: 

You could configure database.yml to use an in-memory SQLite3 database for tests.

John Topley
A: 

@Sam, did you get snailgun working on OS X by chance? While I can get it to work with a simple ruby file, it doesn't seem to want to work with even a vanilla rails app.

bkidd