Tuesday, October 28, 2008
When spec-ing something that calls method which takes a set of nested hashes (as many Rails methods do), it may be tempting to use #hash_including to test for only the values you care about. However #hash_including won’t work the way we might hope for nested hashes. Take the following (highly contrived) example:
describe CoffeeMaker […]
Tuesday, October 21, 2008
Periodically the question of how to test private methods comes up at work or online. My answer is: don’t. It may seem trite, but there is some reasoning behind it.
Private methods are, by definition, implementation details. If you are approaching your tests from a behavioral standpoint – and you really should be, […]