summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJesse Luehrs <doy@tozt.net>2010-06-13 00:05:18 -0500
committerJesse Luehrs <doy@tozt.net>2010-06-13 00:05:18 -0500
commit3cdbd3b4f09e64d737cbc4fb6d64a4e48d6d2db4 (patch)
treeb7ef809253bf4bfdbf550aa272b345bcf3341f83
parent64af885a8d636b16aa6e3c6ac42b212cb9be9d6f (diff)
downloadpod-weaver-section-template-3cdbd3b4f09e64d737cbc4fb6d64a4e48d6d2db4.tar.gz
pod-weaver-section-template-3cdbd3b4f09e64d737cbc4fb6d64a4e48d6d2db4.zip
add basic test
-rw-r--r--t/01-basic.t44
-rw-r--r--t/01/template.section1
-rw-r--r--t/01/weaver.ini9
3 files changed, 54 insertions, 0 deletions
diff --git a/t/01-basic.t b/t/01-basic.t
new file mode 100644
index 0000000..1917f3a
--- /dev/null
+++ b/t/01-basic.t
@@ -0,0 +1,44 @@
+#!/usr/bin/env perl
+use strict;
+use warnings;
+use Test::More;
+
+use FindBin;
+use Pod::Elemental;
+use Pod::Weaver;
+
+my $weaver = Pod::Weaver->new_from_config({root => "$FindBin::Bin/01"});
+
+my $doc = Pod::Elemental->read_string(<<'POD');
+=head1 BEGINNING
+
+start of pod
+
+=head1 ENDING
+
+end of pod
+
+=cut
+POD
+
+my $woven = $weaver->weave_document({pod_document => $doc});
+
+is($woven->as_pod_string, <<'POD', "got the right pod");
+=pod
+
+=head1 BEGINNING
+
+start of pod
+
+=head1 TEMPLATE
+
+got template with parameter FOO
+
+=head1 ENDING
+
+end of pod
+
+=cut
+POD
+
+done_testing;
diff --git a/t/01/template.section b/t/01/template.section
new file mode 100644
index 0000000..00e81f9
--- /dev/null
+++ b/t/01/template.section
@@ -0,0 +1 @@
+got template with parameter {{ $foo }}
diff --git a/t/01/weaver.ini b/t/01/weaver.ini
new file mode 100644
index 0000000..e288519
--- /dev/null
+++ b/t/01/weaver.ini
@@ -0,0 +1,9 @@
+[@CorePrep]
+
+[Generic / BEGINNING]
+
+[Template / TEMPLATE]
+template = t/01/template.section
+foo = FOO
+
+[Generic / ENDING]