You could instantiate an Object and instance_eval the cloud definition into it instead of redefining the behavior of the Object class as you are doing here. This monkey patching is likely to have weird side-effects that will be hard to track back to this test for all other running specs.