1#!/usr/bin/perl
2
3use strict;
4use warnings;
5
6use Test::More;
7
8
9{
10    package Foo::Bar;
11
12    use strict;
13    use warnings;
14
15    use Method::Signatures;
16
17    method new ($class:) { bless {}, $class; }
18
19    method foo1 (Int $bar) {};
20}
21
22my $foobar = Foo::Bar->new;
23
24# at this point, Moose should not be loaded (yet)
25
26is $INC{'Moose/Util/TypeConstraints.pm'}, undef, 'no type checking module loaded before method call';
27
28
29$foobar->foo1(42);
30
31# now we should have loaded Mouse to do our type checking
32
33is $INC{'Moose/Util/TypeConstraints.pm'}, undef, "didn't load Moose";
34
35
36done_testing;
37