1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58
|
#!/usr/bin/env perl
use strict;
use warnings;
use Test::More;
use Test::Exception;
use App::Cmd::Tester;
my $pkg;
BEGIN {
$pkg = 'Catmandu::Cmd';
use_ok $pkg;
}
require_ok $pkg;
use Catmandu::CLI;
my $result = test_app(qq|Catmandu::CLI| => [qw()]);
like $result->stdout, qr/help:/, 'printed what we expected';
is $result->error, undef, 'threw no exceptions';
is $result->stderr, '', 'nothing sent to sderr';
$result = test_app('Catmandu::CLI' => [qw(help)]);
like $result->stdout, qr/commands:/, 'printed what we expected';
is $result->error, undef, 'threw no exceptions';
is $result->stderr, '', 'nothing sent to sderr';
$result = test_app('Catmandu::CLI' => [qw(-h)]);
like $result->stdout, qr/commands:/, 'printed what we expected';
is $result->error, undef, 'threw no exceptions';
is $result->stderr, '', 'nothing sent to sderr';
$result = test_app('Catmandu::CLI' => [qw(--help)]);
like $result->stdout, qr/commands:/, 'printed what we expected';
is $result->error, undef, 'threw no exceptions';
is $result->stderr, '', 'nothing sent to sderr';
$result = test_app('Catmandu::CLI' => [qw(version)]);
like $result->stdout, qr/version $Catmandu::VERSION/,
'printed what we expected';
is $result->error, undef, 'threw no exceptions';
is $result->stderr, '', 'nothing sent to sderr';
$result = test_app('Catmandu::CLI' => [qw(--version)]);
like $result->stdout, qr/version $Catmandu::VERSION/,
'printed what we expected';
is $result->error, undef, 'threw no exceptions';
is $result->stderr, '', 'nothing sent to sderr';
done_testing 20;
|