sub some_code { say 'hello world'; #use_ok( 'NaServer' ) or exit; ## commented out by intend!! my $o = NaServer->new(); exit 111; }
I don't understand why you call exit in your test script - is there a particular reason? (Update: from CB discussion I've learned that some_code is actually part of the tested script, though I don't understand why it then contains use_ok...)
Also what stops you from first setting up the mock object, and then calling trap()?
In reply to Re: Trapping exit AND using mocked objects?
by moritz
in thread Trapping exit AND using mocked objects?
by LANTI
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |