Remove auto_install for mbm as using git is 'too much yak hair'.
[p5sagit/namespace-clean.git] / t_author / 07-debugger.t
1 #!/usr/bin/perl -d
2
3 use Test::More;
4
5 BEGIN {
6     # apparently we can't just skip_all with -d, because the debugger breaks at
7     # Test::Testers END block
8     if ($] <= 5.008008) {
9         pass;
10         done_testing;
11     }
12     else {
13         push @DB::typeahead, "c";
14     }
15
16     push @DB::typeahead, "q";
17
18     # try to shut it up at least a little bit
19     open my $out, ">", \my $out_buf;
20     $DB::OUT = $out;
21     open my $in, "<", \my $in_buf;
22     $DB::IN = $in;
23 }
24
25 {
26     package Foo;
27
28     BEGIN { *baz = sub { 42 } }
29     sub foo { 22 }
30
31     use namespace::clean;
32
33     sub bar {
34         ::is(baz(), 42);
35         ::is(foo(), 22);
36     }
37 }
38
39 ok( !Foo->can("foo"), "foo cleaned up" );
40 ok( !Foo->can("baz"), "baz cleaned up" );
41
42 Foo->bar();
43
44 done_testing;