Re:Testing code is simple
by rahoulb on Thursday September 26, 2013 @08:49AM
(#6450344)
As well has helping with verification, I find unit tests help with design. I write less code, and that code is simpler and with looser coupling when I write tests first.
[ Parent
| on HN ]
This has been my experience as well. And I actually like the rspec style of testing that the author dismisses because it allows you to group tests by functionality covered. This goes a long ways towards making your tests more approachable and maintainable. When I contribute to a Ruby gem with good rspec-style tests it's generally trivial for me to see how to format and where to put my tests covering the new functionality.
I agree.
I've always said that RSpec is about documentation, not testing (hence the name - it's a specification for your code).
However, recently, I've been using Minitest-spec; not quite as readable but less magic and it feels faster.