Skip to content

Commit

Permalink
bug fix
Browse files Browse the repository at this point in the history
when use 5.xx isnt specified in lib, warning message is shown.
  • Loading branch information
tsucchi committed Dec 1, 2009
1 parent 31a924c commit 36c8b31
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 4 deletions.
5 changes: 5 additions & 0 deletions ChangeLog
@@ -1,3 +1,8 @@
2009-12-01 Takuya Tsuchida <tsucchi@cpan.org>

* 0.0.7
fix: bugs in version fetching from file.

2009-11-29 Takuya Tsuchida <tsucchi@cpan.org>

* 0.0.6
Expand Down
4 changes: 2 additions & 2 deletions lib/Test/Module/Used.pm
Expand Up @@ -13,7 +13,7 @@ use List::Util qw(max);
use Perl::MinimumVersion;

use 5.008;
our $VERSION = '0.0.6';
our $VERSION = '0.0.7';

=head1 NAME
Expand Down Expand Up @@ -267,7 +267,7 @@ sub _version_from_file {

my $version = max map {
my $minimum_version = Perl::MinimumVersion->new($_);
$minimum_version->minimum_explicit_version;
$minimum_version->minimum_explicit_version || 0;
} $self->_module_files();
return $version;
}
Expand Down
9 changes: 8 additions & 1 deletion t/005_used_module.t
@@ -1,7 +1,7 @@
#!/usr/bin/perl -w
use strict;
use warnings;
use Test::More tests=>9;
use Test::More tests=>10;
use File::Spec::Functions qw(catfile);
use Test::Module::Used;

Expand Down Expand Up @@ -31,3 +31,10 @@ my $used2 = Test::Module::Used->new(
);
is_deeply([$used2->_used_modules()], [qw(Net::FTP Test::Module::Used)]);
is_deeply([$used2->_used_modules_in_test()], [qw(Test::More SampleModule)]);

# _version_from_file is false if use 5.XX isnt found in lib
my $used3 = Test::Module::Used->new(
module_dir => ['testdata/lib2'],
test_dir => ['testdata/t'],
);
ok( !$used3->_version_from_file );
2 changes: 1 addition & 1 deletion testdata/lib2/My/Test.pm 100644 → 100755
Expand Up @@ -3,7 +3,7 @@ use strict;
use warnings;

our $VERSION = "0.0.1";
use 5.008;
#use 5.008;

=head1 NAME
Expand Down

0 comments on commit 36c8b31

Please sign in to comment.