File: meta_ok.t

package info (click to toggle)
libtest-moose-more-perl 0.024-1
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 312 kB
  • ctags: 25
  • sloc: perl: 303; makefile: 2
file content (42 lines) | stat: -rw-r--r-- 778 bytes parent folder | download | duplicates (4)
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
34
35
36
37
38
39
40
41
42
use strict;
use warnings;


{
    package TestRole;
    use Moose::Role;
}
{
    package TestClass;
    use Moose;
}
{
    package TestClass::Fail;
}

use Test::Builder::Tester; # tests => 1;
use Test::More;
use Test::Moose::More;

use TAP::SimpleOutput 'counters';

my $ROLE = 'TestRole::Role';

for my $thing (qw{ TestClass TestRole }) {
    # role - OK
    my ($_ok, $_nok) = counters();
    test_out $_ok->("$thing has a meta");
    meta_ok $thing;
    test_test "$thing is found to have a metaclass correctly";
}

for my $thing (qw{ TestClass::Fail }) {
    # role - NOT OK
    my ($_ok, $_nok) = counters();
    test_out $_nok->("$thing has a meta");
    test_fail 1;
    meta_ok $thing;
    test_test "$thing is found to not have a metaclass correctly";
}

done_testing;