• How Ryan Davis Schooled Me

    A few weeks ago, I submitted a pull request to the minitest project. Ryan Davis (a.k.a. zenspider) merged my pull request, but also cleaned up the tests I had written. As someone relatively new to Ruby, I found his cleanup very instructive, so I’d like to share it with you. I understood everything he did, but I didn’t think of doing it that way myself. Being a Smalltalker, I understand quite a bit of “the Ruby way”, but Ruby has a number of unique features as well. I feel like I’ve learned the language and its features pretty well, but I still have much to learn about how and when to use those features to full advantage.

    Read more →
  • A Mock Too Far?

    I’ve long felt that the use of a lot of mock objects and other test doubles was a sign of a design smell. I would occasionally hand-build a test double for the rare case when I couldn’t find a better way, but I’d always look for a different option.

    Read more →
  • Forgetting Super Sends

    In object-oriented programming, it is common to extract a superclass when two classes share some common behavior. There are other ways to structure the code, such as using composition and delegation, but for this post, I’ll use inheritance.

    Read more →