Avdi Grimm recently tweeted about a new Udmey course TDD and BDD in Ruby by Roy Osherove. I’m not sure if this was an endorsement by Avdi, or more of a “oh hey, there’s this thing over here which might be interesting” type mention, but when Avdi tweets… people listen, so I decided to go check out the course. What follows is the review I left on the Udmey site, shared here more widely.
As an experienced developer, I’d give this course 3.5 stars if it was an option, but I rounded up because if you don’t know anything about unit testing then this course is a great overview.
The most valuable parts to me were the advanced RSpec overview and discussion of fakes (mocks, stubs). Roy covers this well, but encourages using a 3rd party mock library outside of what RSpec provides called Bogus. The reason is to allow for non-strict mock expectations, which are less brittle since they don’t complain every time a method on the object under test is called that you didn’t explicitly stub out. However, RSpec does support this with the as_null_object method so it would have been nice to not introduce an additional gem unnecessarily.