1use Test::More tests => 10;
2
3use HTTP::Proxy qw( :log );
4
5my $proxy;
6
7$proxy = HTTP::Proxy->new;
8
9# check for defaults
10is( $proxy->logmask, NONE, 'Default log mask' );
11is( $proxy->port, 8080,        'Default port' );
12is( $proxy->host, 'localhost', 'Default host' );
13is( $proxy->agent, undef, 'Default agent' );
14
15# new with arguments
16$proxy = HTTP::Proxy->new(
17    port    => 3128,
18    host    => 'foo',
19    logmask => STATUS,
20);
21
22is( $proxy->port, 3128, 'port set by new' );
23is( $proxy->logmask, STATUS, 'verbosity set by new' );
24is( $proxy->host, 'foo', 'host set by new' );
25
26# check the accessors
27is( $proxy->logmask(NONE), STATUS, 'logmask accessor' );
28is( $proxy->logmask, NONE, 'logmask changed by accessor' );
29
30# check a read-only accessor
31my $conn = $proxy->conn;
32$proxy->conn( $conn + 100 );
33is( $proxy->conn, $conn, 'read-only attribute' );
34
35