RT#57023
[gitmo/MooseX-ConfigFromFile.git] / t / 03configfile_method.t
1 #!/usr/bin/env perl 
2 use strict;
3 use Test::More;
4 use Test::Fatal;
5 {
6     package A;
7     use Moose;
8     with qw(MooseX::ConfigFromFile);
9
10     sub configfile { 'moo' }
11
12     sub get_config_from_file { {} }
13 }
14
15 {
16     package B;
17     use Moose;
18     extends qw(A);
19
20     sub configfile { die; }
21     has configfile => ( is => 'bare', default => 'bar' );
22
23 }
24
25 is(exception { A->new_with_config() }, undef, 'A->new_with_config lives');
26 is(exception { B->new_with_config() }, undef, 'B->new_with_config lives');
27
28 done_testing();