POE::Kernel->run();
my
$CONF
=
do
"config.cache"
;
if
( 0 and
$CONF
->{skip_all_tests} ) {
plan
skip_all
=>
'No SNMP data specified.'
;
}
else
{
plan
tests
=> 6;
}
ok(!$@,
"you just saved a kitten"
);
ok
$POE::Component::SNMP::Dispatcher::INSTANCE
,
'loaded'
;
ok
$POE::Component::SNMP::Dispatcher::INSTANCE
->isa(
'POE::Component::SNMP::Dispatcher'
),
'correct class'
;
eval
{ POE::Component::SNMP->create(
-alias
=>
'snmp'
,
-hosntame
=>
$CONF
->{hostname} ||
'localhost'
,
-community
=>
$CONF
->{community}||
'public'
,
-debug
=>
$CONF
->{debug},
-timeout
=> 5,
)
};
ok $@ =~ /hostname parameter required/,
'catches parameter typo'
;
eval
{ POE::Component::SNMP->create(
-alias
=>
'snmp2'
,
-hostname
=>
$CONF
->{hostname} ||
'localhost'
,
-community
=>
$CONF
->{community}||
'public'
,
-debgu
=>
$CONF
->{debug},
-timeout
=> 5,
)
};
ok $@ =~ /^Invalid argument|The argument .* is unknown/,
'catches parameter typo'
;
eval
{ POE::Component::SNMP->create() };
ok $@ =~ /hostname parameter required at/,
'catches missing required param'
;