Sophie

Sophie

distrib > Mageia > 7 > armv7hl > media > core-release > by-pkgid > 8a491373147e515686522879aa58bcbb > files > 10

perl-Test-YAML-Meta-0.220.0-4.mga7.noarch.rpm

#!/usr/bin/perl -w
use strict;

use Test::More;

# Skip if doing a regular install
plan skip_all => "Author tests not required for installation"
    unless ( $ENV{AUTOMATED_TESTING} );

eval "use Test::YAML::Meta";
plan skip_all => "Test::YAML::Meta required for testing META.yml" if $@;

plan 'no_plan';

my $meta = meta_spec_ok(undef,undef,@_);

use MyDistro;                           # enter your module name here
my $version = $MyDistro::VERSION;       # enter your module name here

is($meta->{version},$version,
    'META.yml distribution version matches');

if($meta->{provides}) {
    for my $mod (keys %{$meta->{provides}}) {
        is($meta->{provides}{$mod}{version},$version,
            "META.yml entry [$mod] version matches");

        eval "require $mod";
        my $VERSION = '$' . $mod . '::VERSION';
        my $v = eval "$VERSION";
        is($meta->{provides}{$mod}{version},$v,
            "META.yml entry [$mod] version matches module version");

        isnt($meta->{provides}{$mod}{version},0);
    }
}