From: Tomas Doran Date: Thu, 26 Aug 2010 09:46:18 +0000 (+0100) Subject: Whitespace X-Git-Tag: 0.32~1 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=86fa042dd5205560ba9a93b5fbffaffa2a49b539;p=gitmo%2FMooseX-Getopt.git Whitespace --- diff --git a/t/107_union_bug.t b/t/107_union_bug.t index f3283c7..1dcba21 100644 --- a/t/107_union_bug.t +++ b/t/107_union_bug.t @@ -7,35 +7,35 @@ use Test::Most tests => 5; { package example; - + use Moose; use Moose::Util::TypeConstraints; with qw( MooseX::Getopt ); - - subtype 'ResultSet' + + subtype 'ResultSet' => as 'DBIx::Class::ResultSet'; - - subtype 'ResultList' + + subtype 'ResultList' => as 'ArrayRef[Int]'; MooseX::Getopt::OptionTypeMap->add_option_type_to_map( 'ResultList' => '=s', ); - - coerce 'ResultList' - => from 'Str' + + coerce 'ResultList' + => from 'Str' => via { return [ grep { m/^\d+$/ } split /\D/,$_ ]; # <- split string into arrayref }; - + has 'results' => ( is => 'rw', isa => 'ResultList | ResultSet', # <- union constraint coerce => 1, ); - + has 'other' => ( is => 'rw', isa => 'Str', @@ -58,8 +58,8 @@ use Test::Most tests => 5; local @ARGV = ('--results','1234,5678,9012','--other','test'); my $example = example->new_with_options; isa_ok($example, 'example'); - + explain($example->results); is($example->other,'test'); cmp_deeply($example->results, [qw(1234 5678 9012)], 'result as expected'); -} \ No newline at end of file +}