Item10498: Fn_MAKETEXT kills Unit Tests suite with redefined subroutine error
Priority: Normal
Current State: Closed
Released In: 1.1.3
Target Release: patch
Tests fail with:
Subroutine available_languages redefined at.../trunk/core/lib/Foswiki/I18N.pm line 32
The problem is that Fn_MAKETEXT in the BEGIN block issues
delete $INC{'Foswiki/I18N.pm'};
but this doesn't clear the symbol table. The following code works much better but calls out additional dependencies for the unit test.
Class::Unload->unload('Foswiki::I18N');
It requires
- Class::Unload
- Class::Inspector
--
GeorgeClark - 17 Mar 2011
The solution has been committed as a comment with a #SMELL
--
GeorgeClark - 17 Mar 2011
Committed a real fix by reading the code from Class::Unload and applying the logic to our problematic.
--
OlivierRaginel - 21 Mar 2011