Today we continue in our series examining mock-object code smells.
Test doubles are a powerful but easy-to-misuse tool for design. In this episode, we look at some tell-tale signes that mocks aren't being used effectively.
Following on to the episodes about #fetch, today's episode answers the question: what do we do when we want the same defaulting behavior everwhere a Hash is used?
In this episode we'll build a simple command-prompt loop in Ruby.
Today's episode has some quick tips on how to get the most out of Ruby's #count method.
This episode looks at Ruby's logical XOR operator, and how it can be useful in checking that a method was called with the correct optional arguments.
This cautionary episode demonstrates and explains a Hash gotcha that often comes as a surprise.
Delving further into Ruby's destructuring assignment, or "splat", mechanism, today we look at some cases where Ruby performs splatting without an explicit '*' operator.
In this final installment on the #fetch method we look at #fetch beyond Hash; #fetch with nested hashes; re-using default blocks; and more.
How to use Hash#fetch to provide defaults for missing keys, and why you might prefer that to other techniques for defaulting values.