Permalink
Browse files

Add (author) test for having a release date in the Changes file

  • Loading branch information...
1 parent d34cf7d commit 184e3346a232b2d9d6016d4b236e73f278a8049f Max Maischein committed Nov 11, 2010
Showing with 29 additions and 0 deletions.
  1. +1 −0 MANIFEST
  2. +28 −0 t/99-changes.t
View
@@ -7,6 +7,7 @@ MANIFEST.skip
README
README.mkdn
t/00-use.t
+t/99-changes.t
t/99-manifest.t
t/99-pod.t
t/99-todo.t
View
@@ -0,0 +1,28 @@
+#!perl -w
+use warnings;
+use strict;
+use File::Find;
+use Test::More tests => 2;
+
+=head1 PURPOSE
+
+This test ensures that the Changes file
+mentions the current version and that a
+release date is mentioned as well
+
+=cut
+
+my $module = 'WWW::Mechanize::Firefox';
+
+(my $file = $module) =~ s!::!/!g;
+require "$file.pm";
+
+my $version = sprintf '%0.2f', $module->VERSION;
+diag "Checking for version " . $version;
+
+my $changes = do { local $/; open my $fh, 'Changes' or die $!; <$fh> };
+
+ok $changes =~ /^(.*$version.*)$/m, "We find version $version";
+my $changes_line = $1;
+ok $changes_line =~ /$version\s+20\d{6}/, "We find a release date on the same line"
+ or diag $changes_line;

0 comments on commit 184e334

Please sign in to comment.