Thursday, February 12, 2015

Rails testing

I'm currently working on a rails application.  I'm trying to implement good TDD.  The test suite uses the rspec rails gem , Factory Girl gem, and Travis CI.   I decided to use rspec over Test Unit partly because I've used it in the past, but also because it has about 21 million downloads on ruby gems.  Generally, that means there will be a lot more resources on it, and the documentation is amazing.   Also, on a personal preference level the syntax reads almost like English, so it's easier to understand what your tests are doing.  I chose to use factory girl because after some research, I found out that its easier to maintain.  It also looks like it's well suited for large scale applications.  And at a glance it seems less complicated than fixtures.  Finally,  I'm using Travis CI.  I've been very interested in using Continuous Integration since I first heard about it.  The set up was surprisingly easy, I just connected my github account and added a YAML file to the root of my app.  They even have a sweet badge that you can put on your readme, to let the world know the status of your build.  I'll post more on these tools as my project progresses.

1 comment: