Refactoring in Ruby: TDD your way through Extract Class

There are a lot of refactoring patterns available out there for us. I assume that most of us use these patterns, at certain times without being aware that those refactoring steps are defined as a pattern in the past. In this post, I will take you through an example of refactoring Ruby code with the Extract Class pattern by using Test-Driven Development. Let’s dive in! What went wrong at the test?...

December 28, 2015 · 11 min · Ilija

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