Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Test Pod::Convenience::first-code-block
  • Loading branch information
Paul Cochrane committed Feb 19, 2015
1 parent 6b25b8a commit 42ed02c
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion t/pod-convenience.t
Expand Up @@ -3,7 +3,21 @@ use Test;
use lib 'lib';
use Pod::Convenience;

plan 9;
plan 10;

subtest {
eval_dies_ok('use Pod::Convenience; first-code-block();', "pod argument required");
eval_dies_ok('use Pod::Convenience; first-code-block("moo");', "array argument required");

is(first-code-block(["text"]), '', "non-code POD returns empty string");

my @code-blocks;
@code-blocks.push(Pod::Block::Code.new(contents => ['my $first-block']));
@code-blocks.push(Pod::Block::Code.new(contents => ['my @second-block']));

# XXX: why does this return the *second* block??
is(first-code-block(@code-blocks), 'my @second-block', "first code block returned");
}, "first-code-block";

subtest {
plan 7;
Expand Down

0 comments on commit 42ed02c

Please sign in to comment.