Do

 view release on metacpan or  search on metacpan

t/0.90/can/Data_Object_Args_exists.t  view on Meta::CPAN

method

=cut

# TESTING

use Data::Object::Args;

can_ok "Data::Object::Args", "exists";

local @ARGV = ('--command', 'post', '--action', 'users');

my $data = Data::Object::Args->new(
  named => { command => 0, action => 1 }
);

ok $data->exists(0);
ok $data->exists('command');
ok $data->exists(1);
ok $data->exists('action');
ok $data->exists(2);

t/0.90/can/Data_Object_Args_get.t  view on Meta::CPAN

method

=cut

# TESTING

use Data::Object::Args;

can_ok "Data::Object::Args", "get";

local @ARGV = ('--command', 'post', '--action', 'users');

my $data = Data::Object::Args->new(
  named => { command => 0, action => 2 }
);

is $data->get(0), '--command';
is $data->get('command'), '--command';
is $data->get(1), 'post';
is $data->get('action'), '--action';
is $data->get(2), '--action';

t/0.90/can/Data_Object_Args_name.t  view on Meta::CPAN

method

=cut

# TESTING

use Data::Object::Args;

can_ok "Data::Object::Args", "name";

local @ARGV = ('--command', 'post', '--action', 'users');

my $data = Data::Object::Args->new(
  named => { command => 0, action => 2 }
);

is $data->name(0), 0;
is $data->name('command'), 0;
is $data->name(1), 1;
is $data->name('action'), 2;
is $data->name(2), 2;

t/0.90/can/Data_Object_Args_set.t  view on Meta::CPAN

method

=cut

# TESTING

use Data::Object::Args;

can_ok "Data::Object::Args", "set";

local @ARGV = ('--command', 'post', '--action', 'users');

my $data = Data::Object::Args->new(
  named => { command => 0, action => 2 }
);

is $data->set(0), undef;
is $data->get(0), undef;
is $data->set('command', '--new-command'), '--new-command';
is $data->get(0), '--new-command';
ok !$data->set(4);

t/0.90/can/Data_Object_Args_stashed.t  view on Meta::CPAN

method

=cut

# TESTING

use Data::Object::Args;

can_ok "Data::Object::Args", "stashed";

local @ARGV = ('--command', 'post', '--action', 'users');

my $data = Data::Object::Args->new(
  named => { command => 0, action => 2 }
);

is_deeply $data->stashed, {
  '0' => '--command',
  '1' => 'post',
  '2' => '--action',
  '3' => 'users'

t/0.90/can/Data_Object_Cli_sign.t  view on Meta::CPAN

    []
  }

  sub sign {
    { command => 0, action => 1 }
  }

  1;
}

local @ARGV = ('create', 'user');

my $command = Command->new;

my $args = $command->args;

is $args->command, 'create';
is $args->action, 'user';

ok 1 and done_testing;

t/0.90/can/Data_Object_Cli_spec.t  view on Meta::CPAN

    [qw(resource|r=s verbose|v help|h)]
  }

  sub sign {
    {}
  }

  1;
}

local @ARGV = ('--resource', 'users', '-v');

my $command = Command->new;

my $opts = $command->opts;

is $opts->resource, 'users';
is $opts->verbose, 1;

ok 1 and done_testing;

 view all matches for this distribution
 view release on metacpan -  search on metacpan

( run in 0.841 second using v1.00-cache-2.02-grep-82fe00e-cpan-da92000dfeb )