my $git_dir = "$tmpdir/test.git";
my $maildir = "$tmpdir/md";
my $spamdir = "$tmpdir/spam";
-use_ok 'PublicInbox::WatchMaildir';
+use_ok 'PublicInbox::Watch';
use_ok 'PublicInbox::Emergency';
my $cfgpfx = "publicinbox.test";
my $addr = 'test-public@example.com';
$cfgpfx.watch=maildir:$spamdir
publicinboxlearn.watchspam=maildir:$spamdir
EOF
- my $wm = PublicInbox::WatchMaildir->new($config);
+ my $wm = PublicInbox::Watch->new($config);
is(scalar grep(/is a spam folder/, @w), 1, 'got warning about spam');
is_deeply($wm->{mdmap}, { "$spamdir/cur" => 'watchspam' },
'only got the spam folder to watch');
}
my $config = PublicInbox::Config->new($cfg_path);
-PublicInbox::WatchMaildir->new($config)->scan('full');
+PublicInbox::Watch->new($config)->scan('full');
my $git = PublicInbox::Git->new($git_dir);
my @list = $git->qx(qw(rev-list refs/heads/master));
is(scalar @list, 1, 'one revision in rev-list');
};
$write_spam->();
is(unlink(glob("$maildir/new/*")), 1, 'unlinked old spam');
-PublicInbox::WatchMaildir->new($config)->scan('full');
+PublicInbox::Watch->new($config)->scan('full');
@list = $git->qx(qw(rev-list refs/heads/master));
is(scalar @list, 2, 'two revisions in rev-list');
@list = $git->qx(qw(ls-tree -r --name-only refs/heads/master));
the body of a message to majordomo\@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html\n);
PublicInbox::Emergency->new($maildir)->prepare(\$msg);
- PublicInbox::WatchMaildir->new($config)->scan('full');
+ PublicInbox::Watch->new($config)->scan('full');
@list = $git->qx(qw(ls-tree -r --name-only refs/heads/master));
is(scalar @list, 1, 'tree has one file');
my $mref = $git->cat_file('HEAD:'.$list[0]);
is(unlink(glob("$maildir/new/*")), 1, 'unlinked spam');
$write_spam->();
- PublicInbox::WatchMaildir->new($config)->scan('full');
+ PublicInbox::Watch->new($config)->scan('full');
@list = $git->qx(qw(ls-tree -r --name-only refs/heads/master));
is(scalar @list, 0, 'tree is empty');
@list = $git->qx(qw(rev-list refs/heads/master));
$config->{'publicinboxwatch.spamcheck'} = 'spamc';
{
local $SIG{__WARN__} = sub {}; # quiet spam check warning
- PublicInbox::WatchMaildir->new($config)->scan('full');
+ PublicInbox::Watch->new($config)->scan('full');
}
@list = $git->qx(qw(ls-tree -r --name-only refs/heads/master));
is(scalar @list, 0, 'tree has no files spamc checked');
PublicInbox::Emergency->new($maildir)->prepare(\$msg);
$config->{'publicinboxwatch.spamcheck'} = 'spamc';
@list = $git->qx(qw(ls-tree -r --name-only refs/heads/master));
- PublicInbox::WatchMaildir->new($config)->scan('full');
+ PublicInbox::Watch->new($config)->scan('full');
@list = $git->qx(qw(ls-tree -r --name-only refs/heads/master));
is(scalar @list, 1, 'tree has one file after spamc checked');
sub is_maildir {
my ($dir) = @_;
- PublicInbox::WatchMaildir::is_maildir($dir);
+ PublicInbox::Watch::is_maildir($dir);
}
is(is_maildir('maildir:/hello//world'), '/hello/world', 'extra slash gone');