1 # Re RT#58715 and the claim in the documentation:
2 # If you have Getopt::Long::Descriptive the usage param is also passed to new.
4 # This tests the fix (that fulfills the documentation claim).
6 use strict; use warnings;
7 use Test::More tests => 4;
8 use Test::NoWarnings 1.04 ':early';
12 use strict; use warnings;
14 with 'MooseX::Getopt';
17 Moose::Meta::Class->create('MyClassWithBasic',
18 superclasses => ['MyClass'],
19 roles => [ 'MooseX::Getopt::Basic' ],
22 my $basic_obj = MyClassWithBasic->new_with_options();
23 ok(!$basic_obj->meta->has_attribute('usage'), 'basic class has no usage attribute');
25 Moose::Meta::Class->create('MyClassWithGLD',
26 superclasses => ['MyClass'],
27 roles => [ 'MooseX::Getopt' ],
30 my $gld_obj = MyClassWithGLD->new_with_options();
32 ok($gld_obj->meta->has_attribute('usage'), 'class has usage attribute');
33 isa_ok($gld_obj->usage, 'Getopt::Long::Descriptive::Usage');