Hacker News new | ask | show | jobs
by gyardley 4843 days ago
God yes.

Test::Unit is simple, comes baked in, and because it's not some faux-English DSL your brain isn't constantly fighting with itself making stupid and incorrect assumptions about syntax because 'hey, it looks like English'.

The worst testing-related decision I ever made was using Michael Hardt's Rails Tutorial (which has RSpec baked in) to learn Rails in the first place. Great tutorial otherwise, but it set my testing back immensely - it pretty much meant I did no testing at all. When I finally bit the bullet and decided to learn how to use Test::Unit, I was astounded at how easy it actually was.

Most Rails resources online assume familiarity with so many not-out-of-the-box tools it's a bloody miracle anyone can learn Rails at all. It's a real problem.

3 comments

> it's not some faux-English DSL your brain isn't constantly fighting with itself making stupid and incorrect assumptions about syntax because 'hey, it looks like English'.

I'm doing the same Rails tutorial right now and I constantly feel like this when it comes to writing the RSpec stuff. It just doesn't feel intuitive and logical, in spite of (or maybe because of) its efforts of being just that. The tutorial doesn't really dive into the specifics of it, it's just "Monkey write, Monkey do" without being able to grasp the concepts of it. This completely leaves me in the dark when it comes to writing my own tests.

Yes! Michael Hardt's tutorial is the culprit for me as well.
I write tests primarily with Rspec for personal projects and Cucumber at work. I haven't worked with unit test at all. I like both Rspec and Cucumber. I use Rspec for personal projects because they are more backend Rails side heavy web app. And my company uses Cucumber because we found writing tests based on user behavior to make more sense.

My problem with Rspec is in its error message, whether it is showing why the test failed or that the test code syntax is wrong. I noticed that Rspec is more prone to showing cryptic errors than Cucumber. I've seen some mind boggling error messages that doesn't really help user debug the code. For devs beginning TDD, I can understand why working with Rspec could be annoying. Even now, Rspec doesn't feel second nature to me.