X-Git-Url: http://www.git.stargrave.org/?a=blobdiff_plain;f=t%2Flei-watch.t;h=9a3bfd80551eb7decd376b3e998cfdb891f4e83e;hb=3416172dbe6d05cc3272829d5448323cea3c8961;hp=492f6c1d7790e8e58d6ce6bd40905e609dbfb852;hpb=1218bee34cf04498ac36add5c7e847698be541c2;p=public-inbox.git diff --git a/t/lei-watch.t b/t/lei-watch.t index 492f6c1d..9a3bfd80 100644 --- a/t/lei-watch.t +++ b/t/lei-watch.t @@ -2,7 +2,7 @@ # Copyright all contributors # License: AGPL-3.0+ use strict; use v5.10.1; use PublicInbox::TestCommon; -use File::Path qw(make_path); +use File::Path qw(make_path remove_tree); require_mods('lei'); my $have_fast_inotify = eval { require Linux::Inotify2 } || eval { require IO::KQueue }; @@ -71,9 +71,19 @@ test_lei(sub { 'inotify has Maildir watches'); } - is(xsys(qw(git config -f), $cfg_f, - '--remove-section', "watch.maildir:$md"), - 0, 'unset config state'); + lei_ok 'rm-watch', $md; + lei_ok 'ls-watch', \'refresh watches'; + is($lei_out, '', 'no watches left'); + + lei_ok 'add-watch', $md2; + remove_tree($md2); + lei_ok 'rm-watch', "maildir:".$md2, \'with maildir: prefix'; + lei_ok 'ls-watch', \'refresh watches'; + is($lei_out, '', 'no watches left'); + + lei_ok 'add-watch', $md; + remove_tree($md); + lei_ok 'rm-watch', $md, \'absolute path w/ missing dir'; lei_ok 'ls-watch', \'refresh watches'; is($lei_out, '', 'no watches left');