in reply to Test::MockObject and mocking module subroutines
fake_module() prevents Perl from loading HTML::Encoding, so if its import() does anything that the code your testing needs, you have to do it yourself.
One option is to localize *HTML::Encoding::encoding_from_html_document or the glob in the appropriate package and assign your own subroutine to it there. I don't remember at the moment what Test::MockModule does, but it might handle this for you better than T::MO does.
|
|---|