Commit | Line | Data |
c3398f5b |
1 | #!/usr/bin/env perl |
2 | use strict; |
3 | use warnings; |
df5525b4 |
4 | use Test::More tests => 5; |
c3398f5b |
5 | |
6 | do { |
7 | package Class; |
8 | use Mouse; |
9 | |
10 | no Mouse; |
11 | |
12 | package Child; |
13 | use Mouse; |
14 | extends 'Class'; |
15 | |
16 | no Mouse; |
17 | }; |
18 | |
19 | ok(!Child->can('extends'), "extends keyword is unimported"); |
20 | ok(!Class->can('extends'), "extends keyword is unimported"); |
21 | |
df5525b4 |
22 | do { |
23 | package Foo; |
24 | use Mouse 'has'; |
25 | |
26 | sub extends { "good" } |
27 | |
28 | no Mouse; |
29 | }; |
30 | |
31 | ok(!Foo->can('has'), "has keyword is unimported"); |
3a63a2e7 |
32 | |
33 | ok(Foo->can('extends'), "extends method is NOT unimported"); |
34 | is(eval { Foo->extends }, "good", "extends method is ours, not the extends keyword"); |
df5525b4 |
35 | |