From: Tomas Doran Date: Fri, 13 Aug 2010 14:08:09 +0000 (+0100) Subject: Fix tests X-Git-Tag: 0.08~1 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=d5372a18d0e3c5ac6d90422da6dc00c318921c2d;p=gitmo%2FMooseX-SimpleConfig.git Fix tests --- diff --git a/lib/MooseX/SimpleConfig.pm b/lib/MooseX/SimpleConfig.pm index 8ecdf92..824158d 100644 --- a/lib/MooseX/SimpleConfig.pm +++ b/lib/MooseX/SimpleConfig.pm @@ -10,6 +10,7 @@ use Config::Any (); sub get_config_from_file { my ($class, $file) = @_; + $file = $file->() if ref $file eq 'CODE'; my $files_ref = ref $file eq 'ARRAY' ? $file : [$file]; my $can_config_any_args = $class->can('config_any_args'); diff --git a/t/lib/MXDefaultMultipleConfigsTest.pm b/t/lib/MXDefaultMultipleConfigsTest.pm index 0319e52..397073d 100644 --- a/t/lib/MXDefaultMultipleConfigsTest.pm +++ b/t/lib/MXDefaultMultipleConfigsTest.pm @@ -1,12 +1,7 @@ package MXDefaultMultipleConfigsTest; 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); +extends 'MXDefaultConfigTest'; has '+configfile' => ( default => sub { [ 'test.yaml' ] } );