From 3cdbd3b4f09e64d737cbc4fb6d64a4e48d6d2db4 Mon Sep 17 00:00:00 2001 From: Jesse Luehrs Date: Sun, 13 Jun 2010 00:05:18 -0500 Subject: add basic test --- t/01-basic.t | 44 ++++++++++++++++++++++++++++++++++++++++++++ t/01/template.section | 1 + t/01/weaver.ini | 9 +++++++++ 3 files changed, 54 insertions(+) create mode 100644 t/01-basic.t create mode 100644 t/01/template.section create mode 100644 t/01/weaver.ini 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] -- cgit v1.2.3