Add a trivial test for the rst plugin
authorSimon McVittie <smcv@debian.org>
Sat, 22 Oct 2011 18:46:42 +0000 (19:46 +0100)
committerSimon McVittie <smcv@debian.org>
Sat, 22 Oct 2011 18:46:42 +0000 (19:46 +0100)
Signed-off-by: Simon McVittie <smcv@debian.org>
t/rst.t [new file with mode: 0755]

diff --git a/t/rst.t b/t/rst.t
new file mode 100755 (executable)
index 0000000..4e0c4b7
--- /dev/null
+++ b/t/rst.t
@@ -0,0 +1,22 @@
+#!/usr/bin/perl
+use warnings;
+use strict;
+
+BEGIN {
+       if (system("python -c 'import docutils.core'") != 0) {
+               eval 'use Test::More skip_all => "docutils not available"';
+       }
+}
+
+use Test::More tests => 2;
+
+BEGIN { use_ok("IkiWiki"); }
+
+%config=IkiWiki::defaultconfig();
+$config{srcdir}=$config{destdir}="/dev/null";
+$config{libdir}=".";
+$config{add_plugins}=[qw(rst)];
+IkiWiki::loadplugins();
+IkiWiki::checkconfig();
+
+ok(IkiWiki::htmlize("foo", "foo", "rst", "foo\n") =~ m{\s*<p>foo</p>\s*});