use warnings;
use strict;
-use Test::More tests => 22;
+use Test::More;
BEGIN { use_ok("IkiWiki"); }
BEGIN { use_ok("IkiWiki::Render"); }
ok(! system("rm -rf t/tmp; mkdir t/tmp"));
-$config{verbose} = 1;
$config{srcdir} = 't/tmp';
$config{underlaydir} = 't/tmp';
$config{templatedir} = 'templates';
$config{userdir} = "users";
$config{tagbase} = "tags";
$config{tag_autocreate} = 1;
+$config{tag_autocreate_commit} = 0;
$config{default_pageext} = "mdwn";
$config{wiki_file_prune_regexps} = [qr/^\./];
$config{underlaydirbase} = '.';
is($autofiles{"tags/lucky.mdwn"}{plugin}, "tag");
is($autofiles{"tags/numbers.mdwn"}{plugin}, "tag");
is($autofiles{"tags/primes.mdwn"}{plugin}, "tag");
+is_deeply([sort keys %autofiles], [qw(tags/lucky.mdwn tags/numbers.mdwn tags/primes.mdwn)]);
ok(!-e "t/tmp/tags/lucky.mdwn");
my (%pages, @del);
IkiWiki::gen_autofile("tags/lucky.mdwn", \%pages, \@del);
+ok(! -s "t/tmp/tags/lucky.mdwn");
+ok(-s "t/tmp/.ikiwiki/transient/tags/lucky.mdwn");
is_deeply(\%pages, {"t/tmp/tags/lucky" => 1});
is_deeply(\@del, []);
-ok(-s "t/tmp/tags/lucky.mdwn");
# generating an autofile that already exists does nothing
%pages = @del = ();
is_deeply(\%pages, {});
is_deeply(\@del, ['tags/primes.mdwn']);
-
-# cleanup
-ok(! system("rm -rf t/tmp"));
-
-1;
+done_testing;