summaryrefslogtreecommitdiffstats
path: root/t/extending/class.t
blob: 194cf4c7e8a7d655b286db13156f40f1ad3ab119 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#!/usr/bin/env perl
use strict;
use warnings;
use Test::More;
use lib 't/lib';

{
    package Foo;
    use Moose;
    use Command;

    sub foo {
    }

    command bar => sub {
    };
}

ok(Foo->meta->has_method('bar'));
is_deeply([Foo->meta->get_all_commands], [Foo->meta->get_method('bar')]);
ok(Foo->meta->has_command('bar'));
ok(!Foo->meta->has_command('foo'));

done_testing;