File: 08app_commandline.t

package info (click to toggle)
libbot-basicbot-pluggable-perl 1.30%2Bds1-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 516 kB
  • sloc: perl: 3,153; makefile: 17
file content (49 lines) | stat: -rw-r--r-- 1,293 bytes parent folder | download | duplicates (5)
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
use strict;
use warnings;
use Test::More tests => 10;
use App::Bot::BasicBot::Pluggable;

our @ARGV = (
    qw(
      --server irc
      --port 6666
      --nick botbasic
      --charset latin1
      --store type=Memory
      --module Karma
      --channel foo
      --channel bar
      --list-modules
      --list-stores
      --loglevel fatal
      --password foobar
      --configfile t/configfiles/empty.yaml
      )
);

my $app = App::Bot::BasicBot::Pluggable->new_with_options();

is( $app->server,   'irc',      'setting server via commandline' );
is( $app->loglevel, 'fatal',    'setting fatal via commandline' );
is( $app->port,     6666,       'setting port via commandline' );
is( $app->nick,     'botbasic', 'setting basicbot via commandline' );
is( $app->charset,  'latin1',   'setting charset via commandline' );
isa_ok(
    $app->store,
    'Bot::BasicBot::Pluggable::Store::Memory',
    'store via commandline'
);
ok( $app->list_modules, 'setting list_modules via commandline' );
ok( $app->list_stores,  'setting list_stores via commandline' );

is_deeply(
    $app->module,
    [ 'Karma', 'Auth' ],
'setting modules via commandline and implicit loading of Auth for --password'
);

is_deeply(
    $app->channel,
    [ '#foo', '#bar' ],
    'setting channel via commandline'
);