Deprecate clone_instance
[gitmo/Mouse.git] / t / 006-unimport.t
CommitLineData
c3398f5b 1#!/usr/bin/env perl
2use strict;
3use warnings;
df5525b4 4use Test::More tests => 5;
c3398f5b 5
6do {
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
19ok(!Child->can('extends'), "extends keyword is unimported");
20ok(!Class->can('extends'), "extends keyword is unimported");
21
df5525b4 22do {
23 package Foo;
24 use Mouse 'has';
25
26 sub extends { "good" }
27
28 no Mouse;
29};
30
31ok(!Foo->can('has'), "has keyword is unimported");
3a63a2e7 32
33ok(Foo->can('extends'), "extends method is NOT unimported");
34is(eval { Foo->extends }, "good", "extends method is ours, not the extends keyword");
df5525b4 35