Skip to content

Commit

Permalink
file.documentation should be undef if it has no length
Browse files Browse the repository at this point in the history
  • Loading branch information
clintongormley committed Apr 18, 2015
1 parent 03af28c commit 9ad805c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
1 change: 1 addition & 0 deletions lib/MetaCPAN/Document/File.pm
Expand Up @@ -281,6 +281,7 @@ sub _build_documentation {
my $self = shift;
$self->_build_abstract;
my $documentation = $self->documentation if ( $self->has_documentation );
return undef unless length $documentation;
return undef unless ( ${ $self->pod } );
my @indexed = grep { $_->indexed } @{ $self->module || [] };
if ( $documentation && $self->is_pod_file ) {
Expand Down
8 changes: 3 additions & 5 deletions t/release/moose.t
Expand Up @@ -77,11 +77,9 @@ ok( !$signature, 'SIGNATURE is not documentation' );
$signature = $idx->type('file')->filter(
{
and => [
{ term => { name => 'SIGNATURE' } },

# these came from metacpan-web/lib/MetaCPAN/Web/Model/API/Release.pm:sub modules
{ exists => { field => 'file.pod_lines' } },
{ term => { 'file.indexed' => \1 } },
{ term => { name => 'SIGNATURE' } },
{ exists => { field => 'documentation' } },
{ term => { 'indexed' => \1 } },
]
}
)->first;
Expand Down

0 comments on commit 9ad805c

Please sign in to comment.