Test Doubles: in theory, in Minitest and in RSpec

Those of us that do Test Driven Development have heard about doubles, mocks, stubs, fakes and spies multiple times. Unfortunately there is a ton of confusion about all these words and their meaning. Let’s see what each an every one of these really mean, where we should use them and how the popular testing frameworks for Ruby implement these. Test Doubles So, first things first. One of the biggest misconceptions is that doubles are types of objects that are used in testing....

August 5, 2015 · 12 min · Ilija

Exception handling and testing it with Minitest

When testing our code, we usually go for the happy path (TM). We are awesome developers, we test our code, we are careful and there’s no way our code might crash. Or not really? I often try to think of software as a live being. It thinks, it does stuff and sometimes it gets some things wrong. Just like us. We sometimes trip up while walking, we drop our keys or forget them on our desk at the office....

July 29, 2015 · 6 min · Ilija

Migrating a test suite from RSpec to Minitest

I have always wanted to have some fun with Minitest but until this weekend I never got the chance to do it. For those of you that don’t know, Minitest is a suite of testing facilities, that support TDD, BDD, mocking and benchmarking. Having wanted to play with Minitest, this weekend I decided that I will migrate the test suite of a gem of mine, from RSpec to Minitest. Read on to see how it all went....

July 14, 2015 · 7 min · Ilija