File: version.t

package info (click to toggle)
libapp-cmd-perl 0.337-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 512 kB
  • sloc: perl: 1,722; makefile: 2
file content (28 lines) | stat: -rwxr-xr-x 624 bytes parent folder | download | duplicates (3)
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
#!perl

use strict;
use warnings;

use Test::More;
use App::Cmd::Tester;

use lib 't/lib';

use Test::MyCmd;

{
  my $app = Test::MyCmd->new({ show_version_cmd => 1 });
  my $ret = App::Cmd::Tester->_run_with_capture( $app , [ 'commands' ]);

  like( $ret->{output} , qr/version/ , 'see version in output');
  is( $ret->{error} , undef , 'no errors' );
}
{
  my $app = Test::MyCmd->new({ show_version_cmd => 0 });
  my $ret = App::Cmd::Tester->_run_with_capture( $app , [ 'commands' ]);

  unlike( $ret->{output} , qr/version/ , 'do not see version in output');
  is( $ret->{error} , undef , 'no errors' );
}

done_testing;