}
}
- plan tests => 5;
+ plan tests => 7;
use_ok('MXDefaultConfigTest');
+ use_ok('MXDefaultWithSubConfigTest');
}
# Can it load a simple YAML file with the options
is($foo->req_attr, 'foo', 'req_attr works');
is($foo->direct_attr, 123, 'direct_attr works');
is($foo->inherited_ro_attr, 'asdf', 'inherited_ro_attr works');
+
+ $foo = eval {
+ MXDefaultWithSubConfigTest->new_with_config();
+ };
+ ok(!$@, 'Did not die with good YAML configfile')
+ or diag $@;
}
END { unlink('test.yaml') }
--- /dev/null
+package MXDefaultWithSubConfigTest;
+use Moose;
+with 'MooseX::SimpleConfig';
+
+use Path::Class::File;
+
+has 'direct_attr' => (is => 'ro', isa => 'Int');
+
+has 'req_attr' => (is => 'rw', isa => 'Str', required => 1);
+
+has '+configfile' => ( default => sub { [ 'test.yaml' ] } );
+#has '+configfile' => ( default => 'test.yaml' );
+
+no Moose;
+1;