Created
November 8, 2012 22:24
-
-
Save j1n3l0/4042168 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use 5.014; | |
use Test::Most; | |
use Test::Trap; | |
# Evaluating Test::Trap | |
# Wish the global $trap was returned by the exported trap method. | |
my @response = trap { | |
say {*STDOUT} 'stdout'; | |
say {*STDERR} 'stderr'; | |
exit 1; | |
}; | |
is $trap->exit, 1, 'exit code is 1'; | |
is $trap->stdout, "stdout\n", '$trap->stdout, "stdout\n"'; | |
is $trap->stderr, "stderr\n", '$trap->stderr, "stderr\n"'; | |
done_testing; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment