remove useless shebangs in tests
[gitmo/MooseX-Getopt.git] / t / 108_usage_attr.t
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.
3
4 # This tests the fix (that fulfills the documentation claim).
5
6 use strict; use warnings;
7 use Test::More tests => 3;
8
9 {
10     package MyClass;
11     use strict; use warnings;
12     use Moose;
13     with 'MooseX::Getopt';
14 }
15
16 Moose::Meta::Class->create('MyClassWithBasic',
17     superclasses => ['MyClass'],
18     roles => [ 'MooseX::Getopt::Basic' ],
19 );
20
21 my $basic_obj = MyClassWithBasic->new_with_options();
22 ok(!$basic_obj->meta->has_attribute('usage'), 'basic class has no usage attribute');
23
24 Moose::Meta::Class->create('MyClassWithGLD',
25     superclasses => ['MyClass'],
26     roles => [ 'MooseX::Getopt' ],
27 );
28
29 my $gld_obj = MyClassWithGLD->new_with_options();
30
31 ok($gld_obj->meta->has_attribute('usage'), 'class has usage attribute');
32 isa_ok($gld_obj->usage, 'Getopt::Long::Descriptive::Usage');
33