update foreign tests
[p5sagit/Function-Parameters.git] / t / foreign / Method-Signatures / typeload_notypes.t
1 #!perl
2
3 use strict;
4 use warnings FATAL => 'all';
5
6 use Test::More;
7
8
9 {
10     package Foo::Bar;
11
12     use strict;
13     use warnings;
14
15     use Function::Parameters qw(:strict);
16
17     method new ($class:) { bless {}, $class; }
18
19     # not using a type here, so we won't expect Moose to get loaded
20     method foo1 ($bar) {};
21 }
22
23 my $foobar = Foo::Bar->new;
24
25 # at this point, Moose should not be loaded
26
27 is $INC{'Moose/Util/TypeConstraints.pm'}, undef, 'no type checking module loaded before method call';
28
29
30 $foobar->foo1(42);
31
32 # _still_ should have no Moose because we haven't requested any type checking
33
34 is $INC{'Moose/Util/TypeConstraints.pm'}, undef, 'no type checking module loaded before method call';
35
36
37 done_testing;