Subject: | App::Cmd::Tester does not report error when a command is missing |
my $result = test_app( 'MyApp' => [qw(bogus)] );
is( $result->error, undef, "Ran without error" );
is( $result->exit_code, 0, "Ran without error" );
When there is no MyApp::Command::bogus, the tests still pass. Running
'perl -Ilib bin/myapp bogus' results in exit code 1.
Conceptually, it seems like a missing command should be considered an
error by the result object (even if it's not a thrown exception). And
regardless, the exit_code should match what the command line program
would do.
Possibly you should have $result contain an "exception" field for any
thrown exceptions and "error" then becomes "exception" // "exit_code".
-- David