If you haven't already, or if you are just starting out with Rails, now would be a good time to take a look at MiniTest:
- Included with Ruby 1.9
- Likely to replace Test:Unit in Rails 4
- Complete Suite (Unit, Spec, Mock, Benchmark)
- Fast, readable, efficient
Any other Rails beginners skip through the RSpec tests in a two-footed lunge at Michael Hartl's Rails tutorial?
With the best of intentions I didn't stand a chance:
- Prior experience - my non-Ruby testing consisted of basic manual logical steps
- Frustration - tests take time and I came to the tutorial to learn Rails
- RSpec's alien syntax - strange snake_cased semi English
As a Rails beginner this is what I needed to know about testing before taking the tutorial:
- To write efficient and elegant code we need to check its quality and stability using a testing framework
- Tests are the backbone of a Rails project giving confidence to change and improve
- Would you accept code into your project that isn't tested?
A year on and wanting to improve my testing code and workflow I revisited the holy grail of Rails tutorials with the plan to use MiniTest:spec in place of RSpec.
No real issues so far and couple of nice workarounds here is my GitHub repo *work in progress
Helpful Resources
- MiniTest on Github
- MiniTest Rdoc
- MiniTest Matchers Support - GitHub
- Minimalicous Testing in Ruby 1.9
- MiniTest Cheat Sheet
- A MiniTest::Spec Tutorial - Ruby Inside
- Railscasts Pro Episode 327 MiniTest with Rails (Pro Account Needed)
- Testing Rails 4 with MiniTest (upcoming book)
Please share any MiniTest resources you find and i'll update the list.