Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Test Pod::Convenience::pod-with-title
  • Loading branch information
Paul Cochrane committed Feb 19, 2015
1 parent cb0342f commit e600ff3
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions t/pod-convenience.t
Expand Up @@ -3,6 +3,28 @@ use Test;
use lib 'lib';
use Pod::Convenience;

subtest {
plan 7;
eval_dies_ok('use Pod::Convenience; pod-with-title();', "title argument required");
my $pod = pod-with-title("title text");
isa_ok($pod, Pod::Block::Named);
is($pod.name, "pod", "block name correct");
# XXX: why do we have to dig so far to get to the title here?
is($pod.contents[0].contents[0].contents[0], "title text", "title matches input");
# XXX: what to do when $got is Nil in Test.pm?
# XXX: this next line gives a warning, however should probably handle
# situation more robustly
is($pod.contents[1], Nil, "empty blocks argument gives Nil content");

$pod = pod-with-title("title text", "block text");
is($pod.contents[1], "block text", "simple block text matches input");

my @block_text = [ "a block of text", "another block of text" ];
$pod = pod-with-title("title text", @block_text);
is($pod.contents[1], "a block of text another block of text",
"array block text matches input");
}, "pod-with-title";

subtest {
plan 6;
my $title = "Pod document title";
Expand Down

0 comments on commit e600ff3

Please sign in to comment.