From: Dave Rolsky Date: Fri, 13 Feb 2009 14:56:42 +0000 (+0000) Subject: Add a test that version numbers are consistent across all .pm files - inspired by... X-Git-Tag: 0.70~29 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=ec318f406a5bb74598fbc516ec2e235d1240efe7;p=gitmo%2FMoose.git Add a test that version numbers are consistent across all .pm files - inspired by MX::GlobRef test --- diff --git a/xt/version_numbers.t b/xt/version_numbers.t new file mode 100644 index 0000000..16c7f2f --- /dev/null +++ b/xt/version_numbers.t @@ -0,0 +1,24 @@ +use strict; +use warnings; + +use File::Find::Rule; +use Module::Info; + +use Test::More qw( no_plan ); + + +my %versions; +for my $pm_file ( File::Find::Rule->file->name( qr/\.pm$/ )->in('lib' ) ) { + my $mod = Module::Info->new_from_file($pm_file); + + ( my $stripped_file = $pm_file ) =~ s{^lib/}{}; + + $versions{$stripped_file} = $mod->version; +} + +my $moose_ver = $versions{'Moose.pm'}; + +for my $module ( grep { $_ ne 'Moose.pm' } sort keys %versions ) { + is( $versions{$module}, $moose_ver, + "version for $module is the same as in Moose.pm" ); +}