Pod-Weaver-PluginBundle-SHLOMIF

 view release on metacpan or  search on metacpan

t/has-version.t  view on Meta::CPAN

#!/usr/bin/env perl

use strict;
use warnings;
use Test::More tests => 2;

sub _slurp {
    my $filename = shift;

    open my $in, '<:encoding(utf-8)', $filename
      or die "Cannot open '$filename' for slurping - $!";

    local $/;
    my $contents = <$in>;

    close($in);

    return $contents;
}

use File::Spec ();

{
    my $text = _slurp(
        File::Spec->catfile(
            File::Spec->curdir, split m#/#, "lib/Pod/Weaver/PluginBundle/SHLOMIF.pm"
        )
    );

    my $ver;

    ($ver) = $text =~ m#\$[A-Za-z0-9_:]*?VERSION\s*=\s*'([0-9\.]+)'#ms;

    # TEST
    ok( defined($ver), 'VERSION was matched' );

    # TEST
    cmp_ok( $ver, '>', 0.001, 'VERSION is sane - more than the minimal value' );
}



( run in 1.926 second using v1.01-cache-2.11-cpan-71847e10f99 )