AWS-CLIWrapper

 view release on metacpan or  search on metacpan

t/05_catch_error_options.t  view on Meta::CPAN

no warnings 'uninitialized';

use Test::More;
use AWS::CLIWrapper;

my %default_args = (
  awscli_path => 't/bin/mock-aws',
  nofork => 1,
);

my $tests = eval join "\n", <DATA> or die "$@";

for my $test_name (keys %$tests) {
  next if @ARGV and not grep { $_ eq $test_name } @ARGV;

  my $test = $tests->{$test_name};
  my ($args, $env, $method, $want) = @$test{qw(args env method want)};

  $env = {} unless $env;

  local @ENV{keys %$env} = values %$env;

t/05_catch_error_options.t  view on Meta::CPAN

    cmp_ok $have, $_->[0], $_->[1], "$test_name " . (join ' ', @$_) for @$want;
  }
  else {
    is $have, $want, $test_name;
  }
}


done_testing;

__DATA__
# line 41
{
  'mock-aws version' => {
    method => 'awscli_version',
    want => '2.42.4242',
  },
  'default-catch_error_pattern' => {
    method => 'catch_error_pattern',
    want => undef,
  },

t/06_catch_errors.t  view on Meta::CPAN

use Test::More;
use File::Temp 'tempfile';

use AWS::CLIWrapper;

my %default_wrapper_args = (
  awscli_path => 't/bin/mock-aws',
  nofork => 1,
);

my $tests = eval join "\n", <DATA> or die "$@";

for my $test_name (keys %$tests) {
  next if @ARGV and not grep { $_ eq $test_name } @ARGV;

  my $test = $tests->{$test_name};
  my ($wrapper_args, $env, $command, $subcommand, $cmd_args)
    = @$test{qw(wrapper_args env command subcommand cmd_args)};
  
  $env = {} unless $env;

t/06_catch_errors.t  view on Meta::CPAN


  like "$@", $test->{exception}, "$test_name exception";
  like $AWS::CLIWrapper::Error->{Message}, $test->{error_msg_re},
    "$test_name error message";

  is_deeply $res, $test->{want}, "$test_name result";
}

done_testing;

__DATA__
# line 60
{
  'no-error' => {
    command => 'ecs',
    subcommand => 'list-clusters',
    error_to_die_with => undef,
    error_msg_re => qr{^$},
    exception => qr{^$},
    want => {
      clusterArns => [

xt/01_podspell.t  view on Meta::CPAN

use Test::More;
eval q{ use Test::Spelling };
plan skip_all => "Test::Spelling is not installed." if $@;
add_stopwords(map { split /[\s\:\-]/ } <DATA>);
$ENV{LANG} = 'C';
all_pod_files_spelling_ok('lib');
__DATA__
HIROSE Masaaki
hirose31 _at_ gmail.com
AWS::CLIWrapper
arg
aws
cli
param
awscli
botocore
OPERATIONs



( run in 1.476 second using v1.01-cache-2.11-cpan-cdf2f3d4e48 )