Remove our (now broken) dzil GatherDir subclass
[gitmo/Moose.git] / t / moose_util / method_mod_args.t
1 use strict;
2 use warnings;
3
4 use Test::More;
5 use Test::Fatal;
6 use Moose::Util qw( add_method_modifier );
7
8 my $COUNT = 0;
9 {
10     package Foo;
11     use Moose;
12
13     sub foo { }
14     sub bar { }
15 }
16
17 is( exception {
18     add_method_modifier('Foo', 'before', [ ['foo', 'bar'], sub { $COUNT++ } ]);
19 }, undef, 'method modifier with an arrayref' );
20
21 isnt( exception {
22     add_method_modifier('Foo', 'before', [ {'foo' => 'bar'}, sub { $COUNT++ } ]);
23 }, undef, 'method modifier with a hashref' );
24
25 my $foo = Foo->new;
26 $foo->foo;
27 $foo->bar;
28 is($COUNT, 2, "checking that the modifiers were installed.");
29
30
31 done_testing;