Nathan Hurst
Nathan Hurst

Reputation: 1750

Speeding up rails tests during development by keeping Rails in memory?

When running rspec tests on my rails app using "rake" or "rake spec", it takes a long time to initialize Rails and start running tests.

Is there a way to keep Rails loaded in memory and run tests against it? I'm hoping there's something similar to using "grails interactive" like this How to speed up grails test execution but for Rails.

Upvotes: 2

Views: 255

Answers (3)

SnapShot
SnapShot

Reputation: 5544

There is a Railscast called Spork that specifically discusses this problem at http://railscasts.com/episodes/285-spork and offers an excellent solution with a detailed walkthrough.

Upvotes: 1

jamesc
jamesc

Reputation: 12837

See the most awesome railscast "How I test" http://railscasts.com/episodes/275-how-i-test This uses guard to run a relevant test every time you save a file so you know almost instantly if the code you have written has caused a pass or a fail. Also if you are running on linux then you can use the libnotify and libnotify-rails gems which pop up a window for you (totally unobtrusively) indicating a pass or failure so you don't have to keep checking the console.

Upvotes: 2

apneadiving
apneadiving

Reputation: 115511

It's almost what Spork is all about.

Upvotes: 5

Related Questions