Net-ILO
view release on metacpan or search on metacpan
t/05-connect.t view on Meta::CPAN
#!perl
use strict;
use Net::ILO;
use Test::More tests => 2;
# TODO: mock IO::Socket::SSL object for better testing
my $ilo = Net::ILO->new();
my $connection;
eval { $connection = $ilo->_connect; };
ok( $@ =~ "Can't connect: address not set", 'Connecting without address throws exception' );
$ilo->{_client} = 'Fake connection';
$connection = $ilo->_connect;
ok( $connection eq 'Fake connection', '_connect returns cached connection' );
# so DESTROY doesn't try to disconnect during cleanup
undef $ilo->{_client};
( run in 3.871 seconds using v1.01-cache-2.11-cpan-75ffa21a3d4 )