Gist of the Day: Test::MockModule for Repeatable Tests!

I like repeatable tests. The #1 benefit of repeatable tests is that they’re repeatable. This also means they’re less vulnerable to data changes (e.g. this test depends on this product record remaining unchanged) and don’t pollute your environment. There are two ways that I think you can make your tests repeatable, and I think both of them are equally valid, and each should be used in their appropriate time:

  1. Creating and tearing down fixtures
  2. Using some sort of mocking framework to force a repeatable result from an up-stream dependency that is not what you’re trying to test

Continue reading Gist of the Day: Test::MockModule for Repeatable Tests!