File: setup-inner.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 (40 lines) | stat: -rw-r--r-- 753 bytes parent folder | download | duplicates (4)
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
#!perl
use strict;
use warnings;

use Test::More 'no_plan';

use lib 't/lib';

my $CLASS = 'Test::WSOF';

require_ok($CLASS);

ok($CLASS->isa('App::Cmd'), "$CLASS subclasses App::Cmd");

my $app = $CLASS->new;

is_deeply(
  [ sort $app->command_names ],
  [ sort qw(help --help -h --version -? commands poot version) ],
  "got correct list of registered command names",
);

is_deeply(
  [ sort $app->command_plugins ],
  [ qw(
    App::Cmd::Command::commands
    App::Cmd::Command::help
    App::Cmd::Command::version
    Test::WSOF::Command::poot
  ) ],
  "got correct list of registered command plugins",
);

{
  local @ARGV = qw(poot);
  my $return = eval { $app->run };

  is($return, 'woof woof poot', "inner package commands work with Setup");
}