File: multiple_roles.t

package info (click to toggle)
libmoosex-methodattributes-perl 0.32-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye, forky, sid, trixie
  • size: 496 kB
  • sloc: perl: 648; makefile: 2
file content (28 lines) | stat: -rw-r--r-- 638 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
use strict;
use warnings;

use lib 't/lib';

use Test::More tests => 4;

use MooseX::MethodAttributes ();

# Note - these test classes say use MooseX::MethodAttributes::Role, which is the new 'nicer'
#        way of doing things.

use UsesMultipleRoles;

my $meta = UsesMultipleRoles->meta;

my $foo = $meta->get_method('foo');
ok $foo, 'Got foo method';

my $bar = $meta->get_method('bar');
ok $bar, 'Got bar method';

my $foo_attrs = $meta->get_method_attributes($foo->body);
ok @$foo_attrs, 'foo method has some attributes';

my $bar_attrs = $meta->get_method_attributes($bar->body);
ok @$bar_attrs, 'bar method has some attributes';