Config-Environment

 view release on metacpan or  search on metacpan

t/07-params.t  view on Meta::CPAN


use utf8;
use strict;
use warnings;
use Test::More;
use Config::Environment;

my $params = {
    http => [
        {
            type => 'starman',
            host => '0.0.0.0',
            port => 9000,
            opts => {
                startup_check => 1
            }
        },
        {
            type => 'twiggy',
            host => '0.0.0.0',
            port => 9001,

t/07-params.t  view on Meta::CPAN

is $pass, 's3cret', '$pass is ok';

my $http  = $conf->subdomain('http');
my $http1 = $http->subdomain('1');
my $http2 = $http->subdomain('2');

ok $http,  '$http is ok';
ok $http1, '$http1 is ok';
ok $http2, '$http2 is ok';

is $http1->param('type'), 'starman', 'http1.type is ok';
is $http1->param('host'), '0.0.0.0', 'http1.host is ok';
is $http1->param('port'), 9000,      'http1.port is ok';
is $http1->param('opts.startup_check'), 1, 'http1.startup_check is ok';
is_deeply $http1->param('opts') => { startup => { check => 1 } };

is $http2->param('type'), 'twiggy',  'http2.type is ok';
is $http2->param('host'), '0.0.0.0', 'http2.host is ok';
is $http2->param('port'), 9001,      'http2.port is ok';
is $http2->param('opts.startup_check'), 1, 'http2.startup_check is ok';
is_deeply $http2->param('opts') => { startup => { check => 1 } };

t/08-stash.t  view on Meta::CPAN


use utf8;
use strict;
use warnings;
use Test::More;
use Config::Environment;

my $stash = {
    http => [
        {
            type => 'starman',
            host => '0.0.0.0',
            port => 9000,
            opts => {
                startup_check => 1
            }
        },
        {
            type => 'twiggy',
            host => '0.0.0.0',
            port => 9001,

t/08-stash.t  view on Meta::CPAN

is $pass, 's3cret', '$pass is ok';

my $http  = $conf->subdomain('http');
my $http1 = $http->subdomain('1');
my $http2 = $http->subdomain('2');

ok $http,  '$http is ok';
ok $http1, '$http1 is ok';
ok $http2, '$http2 is ok';

is $http1->param('type'), 'starman', 'http1.type is ok';
is $http1->param('host'), '0.0.0.0', 'http1.host is ok';
is $http1->param('port'), 9000,      'http1.port is ok';
is $http1->param('opts.startup_check'), 1, 'http1.startup_check is ok';
is_deeply $http1->param('opts') => { startup_check => 1 };

is $http2->param('type'), 'twiggy',  'http2.type is ok';
is $http2->param('host'), '0.0.0.0', 'http2.host is ok';
is $http2->param('port'), 9001,      'http2.port is ok';
is $http2->param('opts.startup_check'), 1, 'http2.startup_check is ok';
is_deeply $http2->param('opts') => { startup_check => 1 };



( run in 0.742 second using v1.01-cache-2.11-cpan-e93a5daba3e )