Agent-TCLI

 view release on metacpan or  search on metacpan

t/TCLI.Command.BuildCommandLine.t  view on Meta::CPAN

#!/usr/bin/env perl
# $Id: TCLI.Command.BuildCommandLine.t 48 2007-04-11 12:43:07Z hacker $

use warnings;
use strict;

use Test::More tests => 13;
use Agent::TCLI::Parameter;
#use Agent::TCLI::Request;
#use Getopt::Lucid;
#use POE;
#
#use Data::Dump qw(pp);

# TASK Test suite is not complete. Need more testing for catching errors.
BEGIN {
    use_ok('Agent::TCLI::Command');
}


my $text1 = Agent::TCLI::Parameter->new(
    name 		=> 'text1',
    aliases 	=> 't1',
    constraints => ['ASCII'],
    help 		=> "text for a parameter",
    manual 		=>
    	'This parameter is used for testing the module.',
    type 		=> 'Param',
    default		=> 'text',
    class		=> 'Test::Test',
    show_method	=> 'print',
    cl_option	=> '-t'
);

my $int1 = Agent::TCLI::Parameter->new(
    name 		=> 'int1',
    aliases 	=> 'i1',
    constraints => ['INT'],
    help 		=> "int for a parameter",
    manual 		=>
    	'This parameter is used for testing the module.',
    type 		=> 'Param',
    default		=> 42,
    class		=> 'Test::Test',
    show_method	=> 'print',
    cl_option	=> '-i'
);

my $verbose = Agent::TCLI::Parameter->new(
    name 		=> 'test_verbose',
    aliases 	=> 'verbose|v',
    constraints => ['UINT'],
    help 		=> "an integer for verbosity",
    manual 		=>
    	'This debugging parameter can be used to adjust the verbose setting',
    type 		=> 'Counter',
    cl_option	=> '-v',
);

my $switch = Agent::TCLI::Parameter->new(
    name 		=> 'switch',
    help 		=> "a switch for a parameter",
    manual 		=>
    	'This parameter is used for testing the module.',
    type 		=> 'Switch',
    cl_option	=> '-s',
);

my $test1 = Agent::TCLI::Command->new(
	        'name'		=> 'cmd1',
	        'contexts'	=> {'/' => 'cmd1'},
    	    'help' 		=> 'cmd1 help',
        	'usage'		=> 'cmd1 usage',
        	'topic'		=> 'test',
        	'call_style'=> 'session',



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