Posts

Tools for Testing Ruby On Rails

I’m getting stuck into learning Ruby On Rails and the topic of which tools / frameworks to use for testing came up. Here’s some notes. I’ll be reading up on these testing frameworks in the following order. If you’ve got an thoughts, comments or other ideas, please let me know in the comments.

Test::Unit

  • Vanilla unit tests

rspec

  • TDD (test-driven development), old-skool, very popular

Factorygirl

  • replaces fixtures and test data

Shoulda

  • automating test creation with syntactic shortcuts

Cucumber

  • BDD (behaviour-driven development) tests written in English-ish

Components of Cucumber

webrat

  • Tests full stack

capybara

  • Drop-in replacement for webrat within Cucumber
  • Nicer JavaScript testing than webrat
  • Web front-end testing using Selenium

Some other cool testing tools

specjour

  • Distribute test runs across multiple machine using Bonjour

cijoe

  • A continuous integration server