RailsCasts Pro episodes are now free!

Learn more or hide this

Charles Hoffman's Profile

GitHub User: nothinghappens

Comments by Charles Hoffman


This is really refreshing to see. I think seeing TDD in real action like this may do a lot to help its adoption. I've long felt that there's been a bit of a hypocrisy particularly in the Ruby community that we have it hammered into our heads that we should be doing TDD or BDD or what have you, but are barely at all shown how. I see TDD as adopting the philosophy that writing tests/specs/etc is an integral part of one's development process, not some special separate step -- and yet, all the literature (books, blogs, screencasts) illustrates development without the testing, unless the testing tools are themselves the subject matter, and then you kind of see it in isolation. Even this episode, you've titled it "How I Test" rather than just, "How I Develop." If TDD should be the default way of working, we should treat it that way rather than always talking about it as some special thing.

I've been slow to adopt TDD practices, not because I need any more convincing of their benefit, but because I feel like I don't have a real understanding how it should be done (and even moreso in Rails development, where there's a lot of support infrastructure that needs setting up to spin up the app's environment, test database, fixtures, mocking out authentication, etc, before you can even get started running the tests!) and that frustrates me. I feel guilty every day that goes by that I don't do the right thing. So I'm all in favor of more episodes like this showing the full process. I'll likely be returning to this episode a few times and taking some notes.

Also, I think multiple assertions per example is fine, provided they are closely related and the later ones are more specific (maybe depending on something being tested for in one of the previous ones).