File: loaded-by-default.t

package info (click to toggle)
libcli-osprey-perl 0.08-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 200 kB
  • sloc: perl: 843; makefile: 2
file content (36 lines) | stat: -rw-r--r-- 695 bytes parent folder | download
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
use strict;
use warnings;

use Test::More;
use lib 't/lib';

use OnDemand;

plan tests => 4;

subtest 'subcommand loaded at the start' => sub {
    ok $OnDemand::Foo::loaded;
    ok $OnDemand::Bar::loaded;
};

subtest 'created object, subcommand still loaded' => sub {
    OnDemand->new_with_options;

    ok $OnDemand::Foo::loaded;
    ok $OnDemand::Bar::loaded;
};

subtest 'app ran, subcommand still loaded' => sub {
    OnDemand->new_with_options->run;

    ok $OnDemand::Foo::loaded;
    ok $OnDemand::Bar::loaded;
};

subtest 'app ran w/ subcommand foo' => sub {
    @ARGV = qw/ foo /;
    OnDemand->new_with_options->run;

    ok $OnDemand::Foo::loaded;
    ok $OnDemand::Bar::loaded;
};