It’s such a simple thing. But the amount of confidence that it gives you to work on those complex pieces of code is priceless. If you aren’t using unit testing for at least some of your code, you’re really doing yourself a disservice. If anything, it’ll help you sleep better at night.
Learning ruby through testing it feature by feature – nice idea. Not only do you have a quick reference of everything you’ve ever learned, but if something in the library changes, you’ll know about it quickly.
We have no idea if Ruby did what it should have done: we just know what it did. That is, we used the language as a tool to explore itself. In the same way that a test is better than a specification, the language is better than a description of the language. The test is definitive—when we ask Ruby what the answer to ‘Hello! ’ * 3 is, we’re going to the horse’s mouth. It doesn’t matter what the documentation says; what we’re testing is what actually happens. And that’s learning. So the test is both a learning test and a regression test.