DarkPAN-Indexer

 view release on metacpan or  search on metacpan

t/06-cli.t  view on Meta::CPAN


  print {$fh} JSON->new->pretty->encode(
    { storage                => { type => 'Filesystem', root => "$root" },
      format                 => { type => 'SQLite' },
      packages_version_index => 'modules/packages.db.gz'
    }
  );

  close $fh;

  local @ARGV = ( '--config', $config_file, 'index-darkpan' );

  # construct the CLI with options set directly (no @ARGV simulation)
  my $cli = DarkPAN::Indexer::CLI->new(
    option_specs    => [qw(config|c=s)],
    default_options => {},
    extra_options   => [qw(indexer)],
    commands        => { 'index-darkpan' => \&DarkPAN::Indexer::CLI::cmd_index_darkpan },
  );

  stdout_like( sub { $cli->run }, qr/indexed 1/, 'indexed 1 distribution' );



( run in 1.140 second using v1.01-cache-2.11-cpan-85d3896f969 )