Is there a way to write this test without having to modify a global constant (namely `Object`)?