zby has asked for the wisdom of the Perl Monks concerning the following question:
And here is the error message when I try to run it:use Test::More tests => 1; BEGIN { use Test::MockObject; Test::MockObject->fake_module ( 'HTML::Encoding', encoding_from_html_document => sub{ 'iso' } ); } use_ok( Catalyst::Test, 'LinkDB' );
What is wrong here?1..1 not ok 1 - use Catalyst::Test; # Failed test (t/m/cdbi_link1.t at line 11) # Tried to use 'Catalyst::Test'. # Error: Couldn't load "LinkDB", "Couldn't load "LinkDB::C::Bookm +ark", ""encoding_from_html_document" is not exported by the HTML::Enc +oding module # Can't continue after import errors at lib/LinkDB/C/Bookmark.pm line +9 # BEGIN failed--compilation aborted at t/m/cdbi_link1.t line 11. # Compilation failed in require at /usr/local/share/perl/5.8.4/Module/ +Pluggable/Fast.pm line 66. # " at /usr/local/share/perl/5.8.4/Module/Pluggable/Fast.pm line 68. # Compilation failed in require at /usr/local/share/perl/5.8.4/Catalys +t/Test.pm line 78. # " at /usr/local/share/perl/5.8.4/Catalyst/Test.pm line 80. # BEGIN failed--compilation aborted at (eval 5) line 2. # Looks like you failed 1 test of 1.
I need to add that without the BEGIN block the test runs OK.
This is Test::MockObject VERSION = '0.20' and Perl version 5.8.4.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Test::MockObject and mocking module subroutines
by chromatic (Archbishop) on Jun 22, 2005 at 16:26 UTC |