|
Revision 53, 0.9 kB
(checked in by bkuhn, 10 months ago)
|
- Added SFLC's internally developed tim bot released under AGPLv3
|
| Line | |
|---|
| 1 |
#!/usr/bin/perl |
|---|
| 2 |
use warnings; |
|---|
| 3 |
use strict; |
|---|
| 4 |
use lib qw(./lib); |
|---|
| 5 |
|
|---|
| 6 |
use Test::More no_plan => 1; |
|---|
| 7 |
|
|---|
| 8 |
use Bot::BasicBot::Pluggable; |
|---|
| 9 |
use Bot::BasicBot::Pluggable::Module; |
|---|
| 10 |
|
|---|
| 11 |
our $store; |
|---|
| 12 |
no warnings 'redefine'; |
|---|
| 13 |
sub Bot::BasicBot::Pluggable::Module::store { |
|---|
| 14 |
$store ||= Bot::BasicBot::Pluggable::Store->new; |
|---|
| 15 |
} |
|---|
| 16 |
|
|---|
| 17 |
ok(my $base = Bot::BasicBot::Pluggable::Module->new(), "created base module"); |
|---|
| 18 |
ok($base->var('test', 'value'), "set variable"); |
|---|
| 19 |
ok($base->var('test') eq 'value', 'got variable'); |
|---|
| 20 |
|
|---|
| 21 |
ok($base = Bot::BasicBot::Pluggable::Module->new(), "created new base module"); |
|---|
| 22 |
ok($base->var('test') eq 'value', 'got old variable'); |
|---|
| 23 |
|
|---|
| 24 |
ok($base->unset('test'), 'unset variable'); |
|---|
| 25 |
ok(!defined($base->var('test')), "it's gone"); |
|---|
| 26 |
|
|---|
| 27 |
# very hard to do anything but check existence of these methods |
|---|
| 28 |
ok($base->can($_), "'$_' exists") |
|---|
| 29 |
for (qw(said connected tick emoted init)); |
|---|
| 30 |
|
|---|
| 31 |
ok($base->help, "help returns something"); |
|---|