projects
/
gitmo/Mouse.git
/ blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
history
|
raw
|
HEAD
Test that before/after/around live, and defining a sub within a role
[gitmo/Mouse.git]
/
t
/
400-define-role.t
1
#!/usr/bin/env perl
2
use strict;
3
use warnings;
4
use Test::More tests => 4;
5
use Test::Exception;
6
7
lives_ok {
8
package Role;
9
use Mouse::Role;
10
11
no Mouse::Role;
12
};
13
14
throws_ok {
15
package Role;
16
use Mouse::Role;
17
18
extends 'Role::Parent';
19
20
no Mouse::Role;
21
} qr/Role does not currently support 'extends'/;
22
23
lives_ok {
24
package Role;
25
use Mouse::Role;
26
27
sub foo {}
28
};
29
30
lives_ok {
31
package Role;
32
use Mouse::Role;
33
34
before foo => sub {};
35
after foo => sub {};
36
around foo => sub {};
37
};
38