News for hackers. Stuff that matters.
Re:A routine gem update ended up creating $73k worth of subs... by Too on Saturday January 08, 2022 @01:56AM (#29849314)
A unit test would likely have mocked the mongoid gem with the old behavior.

Integration test on the other hand…

Or Mocking one level further down, not sure about ruby but in Python there is a mongomock package which simulates most of the mongo queries in memory, so an ORM on top of raw queries does not need to be mocked. Because it simulates the database rather than just EXCPECT_CALL it’s also invariant to how you chain operations as long as end result is the same.

There are no comments on this comment yet.