Works in the same way as Test::MockObject, except it emits a warning if called as a class method. This is because (in order for unfake_module() to work) it needs to record what subs have been faked, so they can be restored later.

If you've called fake_module() (or fake_new()), you may need to 'unfake' it later, so the real class can load. This is especially true if you have a whole lot of tests running in one process (such as under Test::Class::Load).

Note, that after calling unfake_module(), you'll need to load the real version of the module in some way (this could probably be added as an option to this method at a later date). If you're loading the modules you're testing with use_ok(), you should be OK.

Also note it's possible to call fake_module() as a class method. If you do this, unfake_module() will die if you call it, since it needs to hold onto some state data in order to unfake the module.