Test::MockPackages::Returns - provides a helper subroutine for creating custom returns
Version 1.00
use Test::MockPackages::Returns qw(returns_code); ... $m->expects( $arg1, $arg2 ) ->returns( returns_code { my (@args) = @ARG; return join ', ', @args; } );
This package contains the returns_code subroutine which provides the capability to have a CODE executed to return a custom value in a returns expectation.
returns_code
Returns a new Test::MockPackages::Returns object. Under the hood, it's really just the same CodeRef which has been blessed into this package.
This subroutine is exported using @EXPORT_OK.
@EXPORT_OK
Return value: a blessed CodeRef.
Written by Tom Peters <tpeters at synacor.com>.
Copyright (c) 2016 Synacor, Inc.
To install Test::MockPackages, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Test::MockPackages
CPAN shell
perl -MCPAN -e shell install Test::MockPackages
For more information on module installation, please visit the detailed CPAN module installation guide.