]>
iEval git - app-devbot.git/blob - t/App-Devbot.t
4 no warnings
'redefine';
6 use Test
::More tests
=> 11;
7 BEGIN { use_ok
('App::Devbot') };
14 $arglist[ARG0
+ $_]=$args[$_] for 0 .. $#args;
19 my ($expected, $testname) = @_;
20 *App
::Devbot
::log_event
= sub { shift; is
"@_", $expected, $testname };
23 *App
::Devbot
::mode_char
= sub { ' ' };
25 set_test
'< nick> Hello, world!', 'public';
26 call_poe \
&App
::Devbot
::on_public
, 'nick!user@host', ['#channel'], 'Hello, world!';
28 set_test
'* nick nicked', 'action';
29 call_poe \
&App
::Devbot
::on_ctcp_action
, 'nick!user@host', ['#channel'], 'nicked';
31 set_test
'-!- nick [user@host] has joined #channel', 'join';
32 call_poe \
&App
::Devbot
::on_join
, 'nick!user@host', '#channel';
34 set_test
'-!- nick [user@host] has left #channel [Leaving!]', 'part';
35 call_poe \
&App
::Devbot
::on_part
, 'nick!user@host', '#channel', 'Leaving!';
37 set_test
'-!- idiot was kicked from #channel by nick [no reason]', 'kick';
38 call_poe \
&App
::Devbot
::on_kick
, 'nick!user@host', '#channel', 'idiot', 'no reason';
40 set_test
'-!- mode/#channel [+oo mgv mgvx] by ChanServ', 'mode';
41 call_poe \
&App
::Devbot
::on_mode
, 'ChanServ!user@host', '#channel', '+oo', 'mgv', 'mgvx';
43 set_test
'-!- nick changed the topic of #channel to: Go away!', 'topic set';
44 call_poe \
&App
::Devbot
::on_topic
, 'nick!user@host', '#channel', 'Go away!';
46 set_test
'-!- Topic unset by nick on #channel', 'topic unset';
47 call_poe \
&App
::Devbot
::on_topic
, 'nick!user@host', '#channel', '';
49 set_test
'-!- nick is now known as newnick', 'nick';
50 call_poe \
&App
::Devbot
::on_nick
, 'nick!user@host', 'newnick', ['#channel'];
52 set_test
'-!- nick [user@host] has quit [Quitting]', 'quit';
53 call_poe \
&App
::Devbot
::on_quit
, 'nick!user@host', 'Quitting', ['#channel'];
This page took 0.068564 seconds and 4 git commands to generate.