summaryrefslogtreecommitdiff
path: root/t/exceptions/moose-meta-method-augmented.t
blob: c9d967740ba1d72883e0f66fb47097292327d8cc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
use strict;
use warnings;

use Test::More;
use Test::Fatal;

use Moose();

{
    my $exception =  exception {
        package Foo;
        use Moose;

        augment 'foo' => sub {};
    };

    like(
        $exception,
        qr/You cannot augment 'foo' because it has no super method/,
        "'Foo' has no super class");

    isa_ok(
        $exception,
        "Moose::Exception::CannotAugmentNoSuperMethod",
        "'Foo' has no super class");

    is(
        $exception->method_name,
        'foo',
        "'Foo' has no super class");
}

done_testing;