diff options
| author | David Phillips <david@yeah.nah.nz> | 2020-04-04 00:21:47 +1300 | 
|---|---|---|
| committer | David Phillips <david@yeah.nah.nz> | 2020-04-04 13:19:55 +1300 | 
| commit | 7744defa1f8a5f1b54d8eb78657bd2c8d73df29f (patch) | |
| tree | 17aa70627d43b251a8265891198ef02a30439705 /test/test_ping.t | |
| parent | b4eb42636ebe66192d0e531bc691b6f38debfbde (diff) | |
| download | idalius-7744defa1f8a5f1b54d8eb78657bd2c8d73df29f.tar.xz | |
WIP: Start writing some plugin tests
Diffstat (limited to 'test/test_ping.t')
| -rwxr-xr-x | test/test_ping.t | 34 | 
1 files changed, 34 insertions, 0 deletions
| diff --git a/test/test_ping.t b/test/test_ping.t new file mode 100755 index 0000000..f7ae60f --- /dev/null +++ b/test/test_ping.t @@ -0,0 +1,34 @@ +#!/usr/bin/env perl + +use strict; +use warnings; + +use Test::Simple tests => 2; + +use Plugin::Ping; + +our $registered; +our $response; +my $expected = "user: pong"; + +sub register_cmd { +	my ($module, $name, $run) = @_; + +	$registered = 1; + +	$response = $run->( +		undef, # irc +		undef, # logger +		'user!who@example.com', +		undef, # where +		undef, # ided +		undef, # rest +		undef, # no reenter +		undef, # arguments +	); +} + +Plugin::Ping->configure(\®ister_cmd, undef, undef, undef); + +ok($registered, "plugin registered command"); +ok($response eq $expected, "echo expectation met"); | 
