File: 05connector.t

package info (click to toggle)
libnet-proxy-perl 0.12-5
  • links: PTS
  • area: main
  • in suites: squeeze, wheezy
  • size: 304 kB
  • ctags: 66
  • sloc: perl: 777; sh: 84; makefile: 44
file content (18 lines) | stat: -rw-r--r-- 417 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
use Test::More tests => 3;
use strict;
use warnings;

use Net::Proxy;
use Net::Proxy::Connector;

my $c = Net::Proxy::Connector->new( );
isa_ok( $c, 'Net::Proxy::Connector' );

# proxy-related methods
eval { $c->set_proxy( [] ); };
like( $@, qr/is not a Net::Proxy object/, 'set_proxy() wants a Net::Proxy' );

my $p = bless {}, 'Net::Proxy';
$c->set_proxy( $p );
is( $c->get_proxy, $p, 'Got the Net::Proxy back' );