aboutsummaryrefslogtreecommitdiff
path: root/test/test_echo.t
blob: d8c1b69cfed53043f49a6649eb2826c1d56e2143 (plain)
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
#!/usr/bin/env perl

use strict;
use warnings;
use Test::Simple tests => 2;
use Mock::CommandRegistry;

use Plugin::Echo;

my $cr = new Mock::CommandRegistry;
my $register = sub { $cr->register(@_); };

Plugin::Echo->configure($register, undef, undef, undef);
ok($cr->is_registered_to_owner("Plugin::Echo", "echo"), "registered command");

my $expected = " Ping pong do the echo thing!";
my %ctx = (
	irc => undef,
	logger => undef,
	who => undef,
	where => undef,
	ided => undef,
	rest => $expected,
	no_reenter => undef,
	args => undef
);
my $response = $cr->run_owned("Plugin::Echo", "echo", %ctx);
ok($response eq $expected, "echo expectation met");