WebService-Gyazo-B

 view release on metacpan or  search on metacpan

t/WebService_Gyazo_setId.t  view on Meta::CPAN


use strict;
use warnings;

use Data::Dumper;
use Test::More tests => 7;

use lib 'lib/';

use constant {
	HTTP_PROXY => 'http',
	SOCKS4_PROXY => 'socks4',
	SOCKS5_PROXY => 'socks',
	HTTPS_PROXY => 'https',
};

use_ok('WebService::Gyazo::B');

my $ua = WebService::Gyazo::B->new();
can_ok($ua, 'setId');

t/WebService_Gyazo_setProxy.t  view on Meta::CPAN

#!/usr/bin/env perl

use Data::Dumper;
use Test::More tests => 90;

use lib 'lib/';

use constant {
	HTTP_PROXY => 'http',
	SOCKS4_PROXY => 'socks4',
	SOCKS5_PROXY => 'socks',
	HTTPS_PROXY => 'https',
};

use_ok('WebService::Gyazo::B');

my $ua = WebService::Gyazo::B->new();
can_ok($ua, 'setProxy');

my @protocols_ok = (HTTP_PROXY, HTTPS_PROXY, SOCKS4_PROXY, SOCKS5_PROXY);
my @ips_ok = qw( 127.0.0.1 11.111.11.111 );
my @ports_ok = qw( 80 8080 100 200 65535 );

for my $protocol (@protocols_ok) {
	for my $ip (@ips_ok) {
		for my $ports (@ports_ok) {
			my $proxy = $protocol.'://'.$ip.':'.$ports;
			is($ua->setProxy($proxy), 1, '$ua->setProxy("'.$proxy.'") == 1 - '.$ua->error);
		}
	}



( run in 1.734 second using v1.01-cache-2.11-cpan-d7a12ab2c7f )