aboutsummaryrefslogtreecommitdiffstats
path: root/t/open311/endpoint/configfile.t
blob: 7f41468ba4ea3291d1f5a80a0e956c2808e22b1a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
use strict; use warnings;

BEGIN {
    package Foo;
    use Moo;
    with 'Open311::Endpoint::Role::ConfigFile';

    has foo => ( is => 'ro', default => 'foo' );
}

package main;
use Test::More;

is +Foo->new->foo, 
    'foo', 'sanity';
is +Foo->new( foo => 'bar')->foo,
    'bar', 'override';
is +Foo->new( config_file => 't/open311/endpoint/config1.yml' )->foo,
    'baz', 'with config';
is +Foo->new( config_file => 't/open311/endpoint/config1.yml', foo => 'qux' )->foo,
    'qux', 'with config, overridden';

done_testing;