Skip to content
This repository
tree: 593d9e55f3
Fetching contributors…

Cannot retrieve contributors at this time

file 41 lines (29 sloc) 1.347 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41
#!perl

use strict;
use warnings;

use Test::More;

use Pinto::Tester;
use Pinto::Tester::Util qw(make_dist_archive);

#------------------------------------------------------------------------------

my $source = Pinto::Tester->new;
$source->populate('JOHN/Baz-1.2 = Baz~1.2 & Nuts~2.3');
$source->populate('PAUL/Nuts-2.3 = Nuts~2.3');

#------------------------------------------------------------------------------

{
  my $archive = make_dist_archive("ME/Foo-Bar-0.01 = Foo~0.01,Bar~0.01 & Baz~1.2");
  my $local = Pinto::Tester->new(init_args => {sources => $source->stack_url});
  $local->run_ok('Add', {archives => $archive, author => 'ME'});

  $local->registration_ok('ME/Foo-Bar-0.01/Foo~0.01');
  $local->registration_ok('ME/Foo-Bar-0.01/Bar~0.01');
  $local->registration_ok('JOHN/Baz-1.2/Baz~1.2');
  $local->registration_ok('PAUL/Nuts-2.3/Nuts~2.3');
}

#------------------------------------------------------------------------------

{
  my $archive = make_dist_archive("ME/Foo-Bar-0.01= Foo~0.01,Bar~0.01 & Baz~2.4");
  my $local = Pinto::Tester->new(init_args => {sources => $source->stack_url});
  $local->run_throws_ok( 'Add', {archives => $archive, author => 'ME'},
                          qr/Cannot find prerequisite Baz~2.4/);
}

#-----------------------------------------------------------------------------

done_testing;
Something went wrong with that request. Please try again.