Rails coverage made easy

by javery on September 3, 2007

For the first time in a long time I added a new category to the blog. The new category is "Ruby/Rails" and will be for any tips or tools I come across as I experiment with Ruby on Rails.

My little side project is coming along nicely, I hope to have something to put out there in beta in a couple weeks… maybe less. This is actually my second time learning Rails (the first time around I ended up getting distracted and put it down for almost a year). So much has changed that it is almost like re-learning everything. One of the problems I had last time around was that I didn’t do a good job writing and running tests, I wanted to make sure I did a better job this time around.

Writing tests is simple, but I wanted to make sure I had good coverage. This led to me to rcov which does a good job of running my tests and showing me a nice HTML output of the coverage. It was still a pain to go and run rcov and hunt down the report (I am used to nice in the IDE integration like TestDriven.NET).

So I did some searching and ran across a nice rake plugin called rails_rcov that does it all for me. Now I can run rake test:test:rcov from TextMate and see all my tests run and view my coverage.

-James

Comments on this entry are closed.

Previous post: Serial Success

Next post: Book Reset