Permalink
Browse files

updated package tests

  • Loading branch information...
barbie committed Aug 12, 2009
1 parent 7ca3ed0 commit fbdff544cd7ff4f7626fabedaa313e527cf3f029
Showing with 39 additions and 4 deletions.
  1. +1 −1 CHANGES
  2. +1 −0 MANIFEST
  3. +17 −3 t/94metatest.t
  4. +20 −0 t/95changedate.t
View
@@ -1,7 +1,7 @@
Revision history for Perl module CPAN::Testers::Common::Article
===============================================================
-0.37 current
+0.37 12/08/2009
- added more regexes to try and extract Perl version.
0.36 12/02/2009
View
@@ -10,6 +10,7 @@ t/11article.t
t/90podtest.t
t/91podcover.t
t/94metatest.t
+t/95changedate.t
t/nntp/126015.txt
t/nntp/125106.txt
t/nntp/1804993.txt
View
@@ -4,8 +4,22 @@ use Test::More;
plan skip_all => "Author tests not required for installation"
unless ( $ENV{AUTOMATED_TESTING} );
-eval "use Test::CPAN::Meta 0.12";
-plan skip_all => "Test::CPAN::Meta 0.12 required for testing META.yml" if $@;
-meta_yaml_ok();
+eval "use Test::CPAN::Meta";
+plan skip_all => "Test::CPAN::Meta required for testing META.yml" if $@;
+plan no_plan;
+my $meta = meta_spec_ok(undef,undef,@_);
+
+use CPAN::Testers::Common::Article;
+my $version = $CPAN::Testers::Common::Article::VERSION;
+
+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");
+ }
+}
View
@@ -0,0 +1,20 @@
+use Test::More;
+use IO::File;
+use CPAN::Testers::Common::Article;
+
+# Skip if doing a regular install
+plan skip_all => "Author tests not required for installation"
+ unless ( $ENV{AUTOMATED_TESTING} );
+
+my $fh = IO::File->new('CHANGES','r') or plan skip_all => "Cannot open Changes file";
+
+plan no_plan;
+
+my $latest = 0;
+while(<$fh>) {
+ next unless(m!^\d!);
+ $latest = 1 if(m!^$CPAN::Testers::Common::Article::VERSION!);
+ like($_, qr!\d[\d._]+\s+\d{2}/\d{2}/\d{4}!,'... version has a date');
+}
+
+is($latest,1,'... latest version not listed');

0 comments on commit fbdff54

Please sign in to comment.