Permalink
Browse files

added full version checks in META tests

  • Loading branch information...
1 parent 3fe0121 commit c81de89d2c5e8a51c2fc139bc1fe42bc2c18c380 @barbie committed May 25, 2014
Showing with 18 additions and 1 deletion.
  1. +1 −0 Changes
  2. +8 −0 t/94metatest.t
  3. +9 −1 t/96metatest.t
View
1 Changes
@@ -4,6 +4,7 @@ Revision history for CPAN-Testers-WWW-Statistics
1.12 2014-05-00
- added cpan/backpan 100 files to CPAN Stats page creation.
- DateTime is now a pre-requisite.
+ - added full version checks in META tests.
1.11 2014-05-11
- build performance data in isolation.
View
8 t/94metatest.t
@@ -24,5 +24,13 @@ 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.json entry [$mod] version matches module version");
+
+ isnt($meta->{provides}{$mod}{version},0);
}
}
View
10 t/96metatest.t
@@ -23,6 +23,14 @@ is($meta->{version},$version,
if($meta->{provides}) {
for my $mod (keys %{$meta->{provides}}) {
is($meta->{provides}{$mod}{version},$version,
- "META.json entry [$mod] version matches");
+ "META.json entry [$mod] version matches distribution version");
+
+ eval "require $mod";
+ my $VERSION = '$' . $mod . '::VERSION';
+ my $v = eval "$VERSION";
+ is($meta->{provides}{$mod}{version},$v,
+ "META.json entry [$mod] version matches module version");
+
+ isnt($meta->{provides}{$mod}{version},0);
}
}

0 comments on commit c81de89

Please sign in to comment.