So today I want to try to explain dependency injection and its advantages. Also I want to show how to implement dependency injection in Ruby using the dry-rb libraries.
Fortunately things usually change for the best, and practices that "worked ok" in the past might be obsolete by now. That happens to old blog posts, including my own as I've been posting for several years.
TLDR: I had trouble figuring out the root cause of a flaky test. I made several theories and used lots of logging to debug the issue. It turns out that this flake only occurs when 4 test files run in a specific order.
Production applications quickly rack up gigabytes of cached data spanning hundreds of thousands of cache keys. Most of that data is fresh, but every once in a while you’ll find a particular family of entries is holding stale data.
I’ve been programming in Object Oriented languages for decades. I couldn’t contain my excitement at the thought of mapping my real-world objects into their Classes and expected the whole world to fall neatly into place. I couldn’t have been more wrong.