]> git.vanrenterghem.biz Git - git.ikiwiki.info.git/blobdiff - t/autoindex.t
add news item for ikiwiki 3.20120203
[git.ikiwiki.info.git] / t / autoindex.t
index 665f0dc1cdf20991f1398b2fc37b1e7eb2de951b..d16e44ca8ebca7a14f5d3bcc601b6add1aeae47d 100755 (executable)
@@ -3,7 +3,7 @@ package IkiWiki;
 
 use warnings;
 use strict;
 
 use warnings;
 use strict;
-use Test::More tests => 37;
+use Test::More tests => 38;
 
 BEGIN { use_ok("IkiWiki"); }
 BEGIN { use_ok("IkiWiki::Render"); }
 
 BEGIN { use_ok("IkiWiki"); }
 BEGIN { use_ok("IkiWiki::Render"); }
@@ -26,6 +26,7 @@ $config{userdir} = "users";
 $config{tagbase} = "tags";
 $config{default_pageext} = "mdwn";
 $config{wiki_file_prune_regexps} = [qr/^\./];
 $config{tagbase} = "tags";
 $config{default_pageext} = "mdwn";
 $config{wiki_file_prune_regexps} = [qr/^\./];
+$config{autoindex_commit} = 0;
 
 is(checkconfig(), 1);
 
 
 is(checkconfig(), 1);
 
@@ -74,8 +75,8 @@ is($autofiles{"deleted.mdwn"}{plugin}, "autoindex");
 %pages = ();
 @del = ();
 IkiWiki::gen_autofile("deleted.mdwn", \%pages, \@del);
 %pages = ();
 @del = ();
 IkiWiki::gen_autofile("deleted.mdwn", \%pages, \@del);
-is_deeply(\%pages, {}) || diag explain \%pages;
-is_deeply(\@del, []) || diag explain \@del;
+is_deeply(\%pages, {});
+is_deeply(\@del, []);
 ok(! -f "t/tmp/deleted.mdwn");
 
 # this page is tried as an autofile, but because it'll be in @del, it's not
 ok(! -f "t/tmp/deleted.mdwn");
 
 # this page is tried as an autofile, but because it'll be in @del, it's not
@@ -85,8 +86,8 @@ ok(! exists $wikistate{autoindex}{autofile}{"gone.mdwn"});
 @del = ("gone.mdwn");
 is($autofiles{"gone.mdwn"}{plugin}, "autoindex");
 IkiWiki::gen_autofile("gone.mdwn", \%pages, \@del);
 @del = ("gone.mdwn");
 is($autofiles{"gone.mdwn"}{plugin}, "autoindex");
 IkiWiki::gen_autofile("gone.mdwn", \%pages, \@del);
-is_deeply(\%pages, {}) || diag explain \%pages;
-is_deeply(\@del, ["gone.mdwn"]) || diag explain \@del;
+is_deeply(\%pages, {});
+is_deeply(\@del, ["gone.mdwn"]);
 ok(! -f "t/tmp/gone.mdwn");
 
 # this page does not exist and has no reason to be re-created, but we no longer
 ok(! -f "t/tmp/gone.mdwn");
 
 # this page does not exist and has no reason to be re-created, but we no longer
@@ -115,9 +116,10 @@ ok(! exists $wikistate{autoindex}{autofile}{"tags.mdwn"});
 @del = ();
 is($autofiles{"tags.mdwn"}{plugin}, "autoindex");
 IkiWiki::gen_autofile("tags.mdwn", \%pages, \@del);
 @del = ();
 is($autofiles{"tags.mdwn"}{plugin}, "autoindex");
 IkiWiki::gen_autofile("tags.mdwn", \%pages, \@del);
-is_deeply(\%pages, {"t/tmp/tags" => 1}) || diag explain \%pages;
-is_deeply(\@del, []) || diag explain \@del;
-ok(-s "t/tmp/tags.mdwn");
+is_deeply(\%pages, {"t/tmp/tags" => 1});
+is_deeply(\@del, []);
+ok(! -s "t/tmp/tags.mdwn");
+ok(-s "t/tmp/.ikiwiki/transient/tags.mdwn");
 
 # needs creating because of an attachment
 ok(! exists $wikistate{autoindex}{autofile}{"attached.mdwn"});
 
 # needs creating because of an attachment
 ok(! exists $wikistate{autoindex}{autofile}{"attached.mdwn"});
@@ -125,8 +127,8 @@ ok(! exists $wikistate{autoindex}{autofile}{"attached.mdwn"});
 @del = ();
 is($autofiles{"attached.mdwn"}{plugin}, "autoindex");
 IkiWiki::gen_autofile("attached.mdwn", \%pages, \@del);
 @del = ();
 is($autofiles{"attached.mdwn"}{plugin}, "autoindex");
 IkiWiki::gen_autofile("attached.mdwn", \%pages, \@del);
-is_deeply(\%pages, {"t/tmp/attached" => 1}) || diag explain \%pages;
-is_deeply(\@del, []) || diag explain \@del;
-ok(-s "t/tmp/attached.mdwn");
+is_deeply(\%pages, {"t/tmp/attached" => 1});
+is_deeply(\@del, []);
+ok(-s "t/tmp/.ikiwiki/transient/attached.mdwn");
 
 1;
 
 1;