clemcke
clemcke

Reputation: 43

How can I decrease my Rails test overhead?

I'm using Test::Unit on a large app with a large number of gem dependencies (>75). I'm trying to develop using BDD, but it takes minutes for the app to load it's dependencies before it can run the tests. Is there a way to preload the dependencies and just auto-run the test on changes, or a similar solution?

Upvotes: 0

Views: 79

Answers (3)

Sergio Tulentsev
Sergio Tulentsev

Reputation: 230561

I am using RSpec and there's a great tool for it, called Spork. It basically loads your app once and then just reloads modified parts. If you combine it with Guard, you get "continuous testing". That is, you hit 'Save' in your editor and tests start executing, giving you instant feedback. This still amazes me after some months :)

Edit

As @THEM points out, there's a plugin for Spork to support TestUnit. You should look into it.

Upvotes: 0

jxpx777
jxpx777

Reputation: 3641

There was also an interesting article about test speed on the 37Signals blog a while back. Might be of interest even if you end up going with Spork or another solution.

Upvotes: 0

THEM
THEM

Reputation: 204

I would look into Spork. It works wonders.

https://github.com/sporkrb/spork

https://github.com/sporkrb/spork-testunit

Upvotes: 2

Related Questions