OK, my first stab at plugin tests is now checked in. To make a plugin test
you create a file of the same name in t/plugin_tests/ and add to that
file:
sub register_tests {
my $self = shift;
my $num_tests = 1;
$self->register_test("test_name", $num_tests);
}
sub test_name {
my $plugin = shift;
# All functions of Test::More available here
ok(1);
}
That's all. You're entirely responsible for creating connection or
transaction objects if you need them and passing them to your plugin. I'll
try and hack up a proper test for something like the dnsbl plugin later. I
checked in a bogus test for check_badrcptto, which is just there to show
how it all works.
For a plugin test to work the plugin has to be in config/plugins. This is
a bummer and I'll work around it some time. Alternatively we could create
some kind of plugin config which lists all the plugins. Not sure exactly
what we need to do here yet.
--
<!-- Matt -->
<:->get a SMart net</:->
I am Jack's broken heart.