Add to each instance of the mocked CAF::FileWriter and CAF::FileEditor classes a reference to the Test::MockModule instance that mocks them (and their internal usage of IO::String too). This forces the DESTROY on the CAF::File* instances before the DESTROY on the Test::MockModule instances. If the Test::MockModule would be destroyed first, it does a unmock_all, causing the CAF::File* DESTROY to run with the unmocked close, which will certainly fail.
Add to each instance of the mocked CAF::FileWriter and CAF::FileEditor classes a reference to the Test::MockModule instance that mocks them (and their internal usage of IO::String too). This forces the DESTROY on the CAF::File* instances before the DESTROY on the Test::MockModule instances. If the Test::MockModule would be destroyed first, it does a unmock_all, causing the CAF::File* DESTROY to run with the unmocked close, which will certainly fail.

jouvin/maven-tools,quattor/maven-tools,quattor/maven-tools,quattor/maven-tools,quattor/maven-tools,jouvin/maven-tools,jouvin/maven-tools,jouvin/maven-tools