diff --git a/Build.PL b/Build.PL index f02b2dd..f26c2d2 100644 --- a/Build.PL +++ b/Build.PL @@ -12,6 +12,7 @@ my %module_build_args = ( 'File::Find' => '0', 'File::Temp' => '0', 'Module::Build' => '0.3601', + 'Scalar::Util' => '0', 'Test::Fatal' => '0', 'Test::More' => '0.88' }, @@ -23,7 +24,7 @@ my %module_build_args = ( 'Kent Fredric ' ], 'dist_name' => 'Dist-Zilla-Plugin-MetaProvides', - 'dist_version' => '1.12044803', + 'dist_version' => '1.12044806', 'license' => 'perl', 'module_name' => 'Dist::Zilla::Plugin::MetaProvides', 'recommends' => {}, diff --git a/Changes b/Changes index c87b16b..88f5fd0 100644 --- a/Changes +++ b/Changes @@ -1,5 +1,10 @@ Revision history for Dist-Zilla-Plugin-MetaProvides +1.12044806 2010-11-07 07:20:55 Pacific/Auckland + A little bit more testing of the codebase, + tests should be now comprehensive enough to + detect most change-bugs. + 1.12044803 2010-11-07 04:26:58 Pacific/Auckland Build ourself using MetaNoIndex to hide corpus/ crap. Add MetaNoIndex to suggest lists. @@ -53,9 +58,9 @@ Revision history for Dist-Zilla-Plugin-MetaProvides 1.10001919 2009-09-12 06:17:57 UTC Dropped the version dep on FindBin because it causes - problems for some. Apparently deping on something that + problems for some. Apparently deping on something that may or may not be in core which may or may not be in core - later is a bad thing. + later is a bad thing. Added CompileTests Add dist.ini to release for diagnostic reasons. diff --git a/MANIFEST b/MANIFEST index ddb0d88..5e9c511 100644 --- a/MANIFEST +++ b/MANIFEST @@ -16,6 +16,8 @@ perlcritic.rc t/00-compile.t t/000-report-versions-tiny.t t/01-MetaProvider-Provider.t +t/02-MetaProvides-ProvideRecord.t +t/03-Types.t t/author-critic.t t/lib/Dist/Zilla/Plugin/FakePlugin.pm t/release-distmeta.t diff --git a/META.json b/META.json index d3938c4..2ca7d16 100644 --- a/META.json +++ b/META.json @@ -63,6 +63,7 @@ "English" : 0, "File::Find" : 0, "File::Temp" : 0, + "Scalar::Util" : 0, "Test::Fatal" : 0, "Test::More" : "0.88" }, @@ -74,19 +75,19 @@ "provides" : { "Dist::Zilla::MetaProvides::ProvideRecord" : { "file" : "lib/Dist/Zilla/MetaProvides/ProvideRecord.pm", - "version" : "1.12044803" + "version" : "1.12044806" }, "Dist::Zilla::MetaProvides::Types" : { "file" : "lib/Dist/Zilla/MetaProvides/Types.pm", - "version" : "1.12044803" + "version" : "1.12044806" }, "Dist::Zilla::Plugin::MetaProvides" : { "file" : "lib/Dist/Zilla/Plugin/MetaProvides.pm", - "version" : "1.12044803" + "version" : "1.12044806" }, "Dist::Zilla::Role::MetaProvider::Provider" : { "file" : "lib/Dist/Zilla/Role/MetaProvider/Provider.pm", - "version" : "1.12044803" + "version" : "1.12044806" } }, "release_status" : "stable", @@ -98,7 +99,7 @@ "web" : "http://github.com/kentfredric/dist-zilla-plugin-metaprovides/tree" } }, - "version" : "1.12044803", + "version" : "1.12044806", "x_BuiltWith" : { "modules" : { "Dist::Zilla::Plugin::Bootstrap::lib" : "0.01000003", @@ -114,6 +115,7 @@ "Moose::Role" : "1.17", "MooseX::Types" : "0.24", "MooseX::Types::Moose" : "0.24", + "Scalar::Util" : "1.23", "Test::Fatal" : "0.003", "Test::More" : "0.96", "namespace::autoclean" : "0.11" diff --git a/META.yml b/META.yml index c269570..98c4128 100644 --- a/META.yml +++ b/META.yml @@ -8,6 +8,7 @@ build_requires: File::Find: 0 File::Temp: 0 Module::Build: 0.3601 + Scalar::Util: 0 Test::Fatal: 0 Test::More: 0.88 configure_requires: @@ -26,16 +27,16 @@ no_index: provides: Dist::Zilla::MetaProvides::ProvideRecord: file: lib/Dist/Zilla/MetaProvides/ProvideRecord.pm - version: 1.12044803 + version: 1.12044806 Dist::Zilla::MetaProvides::Types: file: lib/Dist/Zilla/MetaProvides/Types.pm - version: 1.12044803 + version: 1.12044806 Dist::Zilla::Plugin::MetaProvides: file: lib/Dist/Zilla/Plugin/MetaProvides.pm - version: 1.12044803 + version: 1.12044806 Dist::Zilla::Role::MetaProvider::Provider: file: lib/Dist/Zilla/Role/MetaProvider/Provider.pm - version: 1.12044803 + version: 1.12044806 requires: Dist::Zilla::Role::MetaProvider: 0 Dist::Zilla::Util::EmulatePhase: 0.01000101 @@ -47,7 +48,7 @@ requires: resources: homepage: http://github.com/kentfredric/dist-zilla-plugin-metaprovides/tree repository: git://github.com/kentfredric/dist-zilla-plugin-metaprovides.git -version: 1.12044803 +version: 1.12044806 x_BuiltWith: modules: Dist::Zilla::Plugin::Bootstrap::lib: 0.01000003 @@ -63,6 +64,7 @@ x_BuiltWith: Moose::Role: 1.17 MooseX::Types: 0.24 MooseX::Types::Moose: 0.24 + Scalar::Util: 1.23 Test::Fatal: 0.003 Test::More: 0.96 namespace::autoclean: 0.11 diff --git a/README b/README index a2925b1..9414b7d 100644 --- a/README +++ b/README @@ -3,7 +3,7 @@ NAME in your META.yml VERSION - version 1.12044803 + version 1.12044806 SYNOPSIS In your projects dist.ini diff --git a/lib/Dist/Zilla/MetaProvides/ProvideRecord.pm b/lib/Dist/Zilla/MetaProvides/ProvideRecord.pm index 619d4ac..b7700a0 100644 --- a/lib/Dist/Zilla/MetaProvides/ProvideRecord.pm +++ b/lib/Dist/Zilla/MetaProvides/ProvideRecord.pm @@ -3,7 +3,7 @@ use warnings; package Dist::Zilla::MetaProvides::ProvideRecord; BEGIN { - $Dist::Zilla::MetaProvides::ProvideRecord::VERSION = '1.12044803'; + $Dist::Zilla::MetaProvides::ProvideRecord::VERSION = '1.12044806'; } # ABSTRACT: Data Management Record for MetaProvider::Provides Based Class @@ -49,7 +49,7 @@ Dist::Zilla::MetaProvides::ProvideRecord - Data Management Record for MetaProvid =head1 VERSION -version 1.12044803 +version 1.12044806 =head1 ATTRIBUTES diff --git a/lib/Dist/Zilla/MetaProvides/Types.pm b/lib/Dist/Zilla/MetaProvides/Types.pm index 19ab042..e9954d5 100644 --- a/lib/Dist/Zilla/MetaProvides/Types.pm +++ b/lib/Dist/Zilla/MetaProvides/Types.pm @@ -3,7 +3,7 @@ use warnings; package Dist::Zilla::MetaProvides::Types; BEGIN { - $Dist::Zilla::MetaProvides::Types::VERSION = '1.12044803'; + $Dist::Zilla::MetaProvides::Types::VERSION = '1.12044806'; } # ABSTRACT: Utility Types for the MetaProvides Plugin @@ -32,7 +32,7 @@ Dist::Zilla::MetaProvides::Types - Utility Types for the MetaProvides Plugin =head1 VERSION -version 1.12044803 +version 1.12044806 =head1 SUBTYPES diff --git a/lib/Dist/Zilla/Plugin/MetaProvides.pm b/lib/Dist/Zilla/Plugin/MetaProvides.pm index 501ad40..ef34e7f 100644 --- a/lib/Dist/Zilla/Plugin/MetaProvides.pm +++ b/lib/Dist/Zilla/Plugin/MetaProvides.pm @@ -3,7 +3,7 @@ use warnings; package Dist::Zilla::Plugin::MetaProvides; BEGIN { - $Dist::Zilla::Plugin::MetaProvides::VERSION = '1.12044803'; + $Dist::Zilla::Plugin::MetaProvides::VERSION = '1.12044806'; } # ABSTRACT: Generating and Populating 'provides' in your META.yml @@ -20,7 +20,7 @@ Dist::Zilla::Plugin::MetaProvides - Generating and Populating 'provides' in your =head1 VERSION -version 1.12044803 +version 1.12044806 =head1 SYNOPSIS diff --git a/lib/Dist/Zilla/Role/MetaProvider/Provider.pm b/lib/Dist/Zilla/Role/MetaProvider/Provider.pm index 7ee4d51..df35781 100644 --- a/lib/Dist/Zilla/Role/MetaProvider/Provider.pm +++ b/lib/Dist/Zilla/Role/MetaProvider/Provider.pm @@ -3,7 +3,7 @@ use warnings; package Dist::Zilla::Role::MetaProvider::Provider; BEGIN { - $Dist::Zilla::Role::MetaProvider::Provider::VERSION = '1.12044803'; + $Dist::Zilla::Role::MetaProvider::Provider::VERSION = '1.12044806'; } # ABSTRACT: A Role for Metadata providers specific to the 'provider' key. @@ -134,7 +134,7 @@ Dist::Zilla::Role::MetaProvider::Provider - A Role for Metadata providers specif =head1 VERSION -version 1.12044803 +version 1.12044806 =head1 PERFORMS ROLES diff --git a/t/000-report-versions-tiny.t b/t/000-report-versions-tiny.t index 9e44fa7..162d7ec 100644 --- a/t/000-report-versions-tiny.t +++ b/t/000-report-versions-tiny.t @@ -63,6 +63,7 @@ eval { $v .= pmver('Moose','any version') }; eval { $v .= pmver('Moose::Role','any version') }; eval { $v .= pmver('MooseX::Types','any version') }; eval { $v .= pmver('MooseX::Types::Moose','any version') }; +eval { $v .= pmver('Scalar::Util','any version') }; eval { $v .= pmver('Test::Fatal','any version') }; eval { $v .= pmver('Test::More','0.88') }; eval { $v .= pmver('namespace::autoclean','any version') }; diff --git a/t/02-MetaProvides-ProvideRecord.t b/t/02-MetaProvides-ProvideRecord.t new file mode 100644 index 0000000..3d2a71b --- /dev/null +++ b/t/02-MetaProvides-ProvideRecord.t @@ -0,0 +1,69 @@ +use strict; +use warnings; + +use Test::More; +use lib 't/lib'; + +use Dist::Zilla::Util::Test::KENTNL qw( test_config ); +use Dist::Zilla::MetaProvides::ProvideRecord; +use Test::Fatal; +use Scalar::Util qw( refaddr ); + +my $fake_dzil = test_config( + { + dist_root => 'corpus/dist/DZT', + ini => [ 'GatherDir', [ 'Prereqs' => { 'Test::Simple' => '0.88' } ], [ 'FakePlugin' => {} ] ], + } +); + +my $record; + +is( + exception { + $record = Dist::Zilla::MetaProvides::ProvideRecord->new( + version => '1.0', + module => 'FakeModule', + file => 'fakefile', + parent => $fake_dzil->plugin_named('FakePlugin'), + ); + }, + undef, + 'Construction works' +); + +can_ok( $record, 'version' ); +is( $record->version, '1.0', 'version is consistent' ); + +can_ok( $record, 'module' ); +is( $record->module, 'FakeModule', 'module is consistent' ); + +can_ok( $record, 'file' ); +is( $record->file, 'fakefile', 'file is consistent' ); + +can_ok( $record, 'parent' ); +is( refaddr $record->parent, refaddr $fake_dzil->plugin_named('FakePlugin'), 'parent link is right' ); + +can_ok( $record, 'zilla' ); +is( refaddr $record->zilla, refaddr $fake_dzil , 'dzil link is right' ); + +can_ok( $record, '_resolve_version' ); + +is_deeply( [ $record->_resolve_version(3.1415) ], [ 'version', '0.001' ], '_resolve_version internal works as expected' ); + +can_ok( $record, 'copy_into' ); + +my $hash = {}; +$record->copy_into($hash); + +is_deeply( + $hash, + { + FakeModule => { + file => 'fakefile', + version => '0.001', + } + }, + 'copy_into structures match' +); + +done_testing; diff --git a/t/03-Types.t b/t/03-Types.t new file mode 100644 index 0000000..56dfe35 --- /dev/null +++ b/t/03-Types.t @@ -0,0 +1,30 @@ +use strict; +use warnings; + +use Test::More; + +use Dist::Zilla::MetaProvides::Types qw( :all ); + +{ + + package Dist::Zilla::Role::MetaProvider::Provider; + use Moose::Role; +} +{ + + package Test; + use Moose; + with 'Dist::Zilla::Role::MetaProvider::Provider'; + __PACKAGE__->meta->make_immutable; +} + +isa_ok( \&ModVersion, 'CODE' ); +isa_ok( \&ProviderObject, 'CODE' ); +isa_ok( \&is_ModVersion, 'CODE' ); +isa_ok( \&is_ProviderObect, 'CODE' ); +ok( is_ModVersion('1.0'), '1.0 is a valid module version' ); +ok( is_ModVersion(undef), 'undef is a valid module version' ); +ok( is_ModVersion('9999'), '9999 is a valid module version' ); +ok( is_ProviderObject( Test->new() ), 'Given obeject is a ProviderObject' ); + +done_testing;