]> git.vpit.fr Git - perl/modules/with.git/blob - t/13-scope.t
Importing with-0.01
[perl/modules/with.git] / t / 13-scope.t
1 #!perl -T
2
3 use strict;
4 use warnings;
5
6 use Test::More 'no_plan';
7
8 sub bait { ok !$_[0], 'object shouldn\'t be called' }
9 sub with::Mock::bait { ok $_[1], 'object should be called' }
10
11 my $obj = bless {}, 'with::Mock';
12
13 sub alpha {
14  use with \$obj;
15  bait 1;
16 }
17
18 bait 0;
19
20 sub beta {
21  bait 0;
22 }
23
24 sub main::gamma { bait 0 }