7 my %config_from_file_args;
11 with qw(MooseX::ConfigFromFile);
13 sub configfile { die 'should not ever be here' }
15 sub get_config_from_file {
16 my ($class, $file) = @_;
17 $config_from_file_args{$class} = $file;
27 sub configfile { die; }
28 has configfile => ( is => 'bare', default => 'bar' );
36 sub configfile { die; }
41 $class = blessed($class) || $class;
47 is(exception { A->new_with_config() }, undef, 'A->new_with_config lives');
48 is($config_from_file_args{A}, undef, 'there is no configfile for A');
50 is(exception { B->new_with_config() }, undef, 'B->new_with_config lives');
51 is($config_from_file_args{B}, 'bar', 'B configfile attr default sub is called');
53 is(exception { C->new_with_config() }, undef, 'C->new_with_config lives');
54 is($config_from_file_args{C}, '/dir/C', 'C configfile attr default sub is called, with classname');