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