File: 01module_base.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 (32 lines) | stat: -rwxr-xr-x 928 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
#!/usr/bin/perl
use warnings;
use strict;
use lib qw(./lib);

use Test::More tests => 13;

use Bot::BasicBot::Pluggable;
use Bot::BasicBot::Pluggable::Module;

our $store;
no warnings 'redefine';

sub Bot::BasicBot::Pluggable::Module::store {
    $store ||= Bot::BasicBot::Pluggable::Store->new;
}

ok( my $base = Bot::BasicBot::Pluggable::Module->new(), "created base module" );
ok( $base->var( 'test', 'value' ), "set variable" );
ok( $base->var('test') eq 'value', 'got variable' );

ok( $base = Bot::BasicBot::Pluggable::Module->new(),
    "created new base module" );
ok( $base->var('test') eq 'value', 'got old variable' );

ok( $base->unset('test'),           'unset variable' );
ok( !defined( $base->var('test') ), "it's gone" );

# very hard to do anything but check existence of these methods
ok( $base->can($_), "'$_' exists" ) for (qw(said connected tick emoted init));

ok( $base->help, "help returns something" );