I'm writing unit tests using Test::More and Test::Output. I use Test::More to validate the return values and I plan to use Test::Output to validate the stdout produced by my subroutines.
I am attempting to write test cases for a subroutine whose stdout is dependent on the arguments sent. Test::Output::stdout_like(code reference, regexp, test description) looks to have the functionality I want, however I am struggling to construct a code reference which contains an argument.
I presume this is a common practice within Perl unit testing scripts. Can anyone offer an example?
Side note, thanks to Kurt W. Leucht for his Perl unit testing introduction: Perl build, unit testing, code coverage: A complete working example