diff options
Diffstat (limited to 'test/test_echo.t')
-rwxr-xr-x | test/test_echo.t | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/test/test_echo.t b/test/test_echo.t new file mode 100755 index 0000000..73ff0e8 --- /dev/null +++ b/test/test_echo.t @@ -0,0 +1,34 @@ +#!/usr/bin/env perl + +use strict; +use warnings; + +use Test::Simple tests => 2; + +use Plugin::Echo; + +my $expected = " Ping pong do the echo thing!"; +our $registered; +our $response; + +sub register_cmd { + my ($module, $name, $run) = @_; + + $registered = 1; + + $response = $run->( + undef, # irc + undef, # logger + undef, # who + undef, # where + undef, # ided + $expected, + undef, # no reenter + undef, # arguments + ); +} + +Plugin::Echo->configure(\®ister_cmd, undef, undef, undef); + +ok($registered, "plugin registered command"); +ok($response eq $expected, "echo expectation met"); |