3 # Re RT#58715 and the claim in the documentation:
4 # If you have Getopt::Long::Descriptive the usage param is also passed to new.
6 # This tests the fix (that fulfills the documentation claim).
8 use strict; use warnings;
9 use Test::More tests => 3;
13 use strict; use warnings;
15 with 'MooseX::Getopt';
18 Moose::Meta::Class->create('MyClassWithBasic',
19 superclasses => ['MyClass'],
20 roles => [ 'MooseX::Getopt::Basic' ],
23 my $basic_obj = MyClassWithBasic->new_with_options();
24 ok(!$basic_obj->meta->has_attribute('usage'), 'basic class has no usage attribute');
26 Moose::Meta::Class->create('MyClassWithGLD',
27 superclasses => ['MyClass'],
28 roles => [ 'MooseX::Getopt' ],
31 my $gld_obj = MyClassWithGLD->new_with_options();
33 ok($gld_obj->meta->has_attribute('usage'), 'class has usage attribute');
34 isa_ok($gld_obj->usage, 'Getopt::Long::Descriptive::Usage');