4 use Test::More tests => 6;
5 use Test::NoWarnings 1.04 ':early';
11 use Moose::Util::TypeConstraints;
17 => as 'DBIx::Class::ResultSet';
20 => as 'ArrayRef[Int]';
22 MooseX::Getopt::OptionTypeMap->add_option_type_to_map(
29 return [ grep { m/^\d+$/ } split /\D/,$_ ]; # <- split string into arrayref
34 isa => 'ResultList | ResultSet', # <- union constraint
44 # Without MooseX::Getopt
46 my $example = example->new({
47 results => '1234,5678,9012',
50 isa_ok($example, 'example');
51 is_deeply($example->results, [qw(1234 5678 9012)], 'result as expected');
56 local @ARGV = ('--results','1234,5678,9012','--other','test');
57 my $example = example->new_with_options;
58 isa_ok($example, 'example');
60 is($example->other,'test');
61 is_deeply($example->results, [qw(1234 5678 9012)], 'result as expected');