#!perl
my
$t
= Pinto::Tester->new;
$t
->populate(
'AUTHOR/Foo-3 = Foo-4 & Bar~1; perl~5.6.0; strict'
);
my
$dist
=
$t
->get_distribution(
author
=>
'AUTHOR'
,
archive
=>
'Foo-3.tar.gz'
);
ok
defined
$dist
,
'Got the distribution back'
;
my
$meta
=
$dist
->metadata;
isa_ok
$meta
,
'CPAN::Meta'
;
is
$meta
->as_struct->{version},
'3'
,
'META has correct dist version'
;
is
$meta
->as_struct->{provides}->{Foo}->{version},
'4'
,
'META has correct package version'
;
is
$meta
->as_struct->{
'meta-spec'
}->{version},
'2'
,
'META has correct meta spec version'
;
my
$prereqs
=
$meta
->as_struct->{prereqs};
is
$prereqs
->{runtime}->{requires}->{Bar},
'1'
,
'Requires Bar~1'
;
is
$prereqs
->{runtime}->{requires}->{perl},
'v5.6.0'
,
'Requires perl~5.6.0'
;
is
$prereqs
->{runtime}->{requires}->{strict},
'0'
,
'Requires strict~0'
;
done_testing;