Skip to content

Commit

Permalink
Add (author) test for having a release date in the Changes file
Browse files Browse the repository at this point in the history
  • Loading branch information
Max Maischein committed Nov 11, 2010
1 parent d34cf7d commit 184e334
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 0 deletions.
1 change: 1 addition & 0 deletions MANIFEST
Expand Up @@ -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
Expand Down
28 changes: 28 additions & 0 deletions t/99-changes.t
@@ -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.