WARNING: mock.should_receive(:msg).with(an_instance_of(klass)) now correctly uses instance_of? instead of kind_of?. This may break some existing code examples, but the fix is to just use kind_of instead of an_instance_of