test for use Moo after no Moo
[gitmo/Moo.git] / t / use-after-no.t
CommitLineData
69b39671 1use strictures 1;
2use Test::More;
3
4ok eval q{
5 package Spoon;
6 use Moo;
7
8 has foo => ( is => 'ro' );
9
10 no Moo;
11
12 use Moo;
13
14 has foo2 => ( is => 'ro' );
15
16 no Moo;
17
18 1;
19}, "subs imported on 'use Moo;' after 'no Moo;'"
20 or diag $@;
21
22ok eval q{
23 package Roller;
24 use Moo;
25
26 has foo => ( is => 'ro' );
27
28 no Moo;
29
30 use Moo;
31
32 has foo2 => ( is => 'ro' );
33
34 no Moo;
35
36 1;
37}, "subs imported on 'use Moo::Role;' after 'no Moo::Role;'"
38 or diag $@;
39
40done_testing;