-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Build results of c7e66bc (on master)
- Loading branch information
Showing
13 changed files
with
134 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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; |