Revert most of the conversion to Test::Fatal so we can redo it
[gitmo/Moose.git] / t / 400_moose_util / 008_method_mod_args.t
1 use strict;
2 use warnings;
3
4 use Test::More;
5 use Test::Exception;
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 lives_ok {
18     add_method_modifier('Foo', 'before', [ ['foo', 'bar'], sub { $COUNT++ } ]);
19 } 'method modifier with an arrayref';
20
21 dies_ok {
22     add_method_modifier('Foo', 'before', [ {'foo' => 'bar'}, sub { $COUNT++ } ]);
23 } '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;