aboutsummaryrefslogtreecommitdiffstats
path: root/t/lib.t
diff options
context:
space:
mode:
authorBrian Cully <bjc@kublai.com>2015-10-20 10:51:11 -0400
committerBrian Cully <bjc@kublai.com>2015-10-20 12:08:36 -0400
commitf887806c5989fc3e5c86107d6ff945a6fc63b05c (patch)
tree433bd701b6b03e6b1ebd0d800e6469aef61cc3e7 /t/lib.t
parentb22b545fbe0f9d58792fd6b9659dd5013459c66d (diff)
downloadspamcat-f887806c5989fc3e5c86107d6ff945a6fc63b05c.tar.gz
spamcat-f887806c5989fc3e5c86107d6ff945a6fc63b05c.zip
Various changes.
* Use `env' to find perl binary. * Change flag --dumpconfig to command. * Add `dump' command to output table in tab-delimited format. * Update documentation.
Diffstat (limited to 't/lib.t')
-rw-r--r--t/lib.t15
1 files changed, 14 insertions, 1 deletions
diff --git a/t/lib.t b/t/lib.t
index 21e1c09..1f32c08 100644
--- a/t/lib.t
+++ b/t/lib.t
@@ -1,6 +1,6 @@
# -*- Mode: cperl -*-
-use Test::More tests => 31;
+use Test::More tests => 41;
use strict;
use warnings;
@@ -63,6 +63,19 @@ test_file('wrongdomain', 1);
test_file('nosubj', 1);
test_file('bar', 0);
+ok(SpamCat->can('get_table'));
+my @rows = @{$sch->get_table()};
+is($#rows, 3);
+@rows = sort { $a->{sender} cmp $b->{sender} } @rows;
+is($rows[0]->{sender}, 'bar');
+is($rows[0]->{count}, 0);
+is($rows[1]->{sender}, 'foo');
+is($rows[1]->{count}, 16);
+is($rows[2]->{sender}, 'name1');
+is($rows[2]->{count}, 20);
+is($rows[3]->{sender}, 'nosubj');
+is($rows[3]->{count}, 20);
+
sub test_file {
my ($filen, $should_exist) = @_;