in reply to Re: Test::MockObject not showing args when mocking a sub
in thread Test::MockObject not showing args when mocking a sub
OK, so the arg list in the mocked call gets a MockObject ref unshifted into the first position. Saying
This signature will be ready by Christmas
gives$port->mock ('write', sub {my $Mock=shift;my $arg=shift;$arg=~s/\r/\n/g;print " +wrote $arg to the serial port\n";});
Thank you!wrote ATE0 to the serial port wrote AT+CMGF=1 to the serial port wrote AT+CPIN=9532 to the serial port wrote ATI to the serial port
This signature will be ready by Christmas
|
---|
In Section
Seekers of Perl Wisdom