summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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]