Alien-Build-Plugin-Fetch-Cache

 view release on metacpan or  search on metacpan

t/alien_build_plugin_fetch_cache.t  view on Meta::CPAN

          { filename => 'file2.txt', url => 'https://foo.test/file2.txt' },
        ],
      },
      'expected index',
    );

    is($main::count, 1, 'not cached' );

  };

  subtest 'second index' => sub {

    $main::count = 0;

    my $res = $fetch->('https://foo.test/');
    is(
      $res,
      { type => 'list',
        protocol => 'https',
        list => [
          { filename => 'file1.txt', url => 'https://foo.test/file1.txt' },
          { filename => 'file2.txt', url => 'https://foo.test/file2.txt' },
        ],
      },
      'expected index',
    );

    is($main::count, 0, 'cached' );

  };

  subtest 'second index inferred URL' => sub {

    $main::count = 0;
    local $build->meta_prop->{start_url} = 'https://foo.test/';

    my $res = $fetch->();
    is(
      $res,
      { type => 'list',
        protocol => 'https',
        list => [

t/alien_build_plugin_fetch_cache.t  view on Meta::CPAN

      },
      'expected file',
    );
    is(
      $main::count,
      1,
      'not cached'
    );
  };

  subtest 'second file1' => sub {

    $main::count = 0;

    my $res = $fetch->('https://foo.test/file1.txt');
    is(
      $res,
      hash {
        field type     => 'file';
        field filename => 'file1.txt';
        field path     => T();

t/alien_build_plugin_fetch_cache.t  view on Meta::CPAN

      },
      'expected file',
    );
    is(
      $main::count,
      1,
      'not cached'
    );
  };

  subtest 'second file1' => sub {

    $main::count = 0;

    my $res = $fetch->('https://foo.test/file2.txt');
    is(
      $res,
      hash {
        field type     => 'file';
        field filename => 'file2.txt';
        field path     => T();



( run in 1.024 second using v1.01-cache-2.11-cpan-39bf76dae61 )