File: accessor_satisfaction.t

package info (click to toggle)
libmoosex-abstractmethod-perl 0.004-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 208 kB
  • sloc: perl: 334; makefile: 2
file content (50 lines) | stat: -rw-r--r-- 833 bytes parent folder | download | duplicates (2)
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
43
44
45
46
47
48
49
50
#!/usr/bin/env perl
#
# This file is part of MooseX-AbstractMethod
#
# This software is Copyright (c) 2011 by Chris Weyl.
#
# This is free software, licensed under:
#
#   The GNU Lesser General Public License, Version 2.1, February 1999
#

# make sure methods installed from attributes (accessors and the like) satisfy
# our abstract requirement

use Test::More 0.82;
use Test::Moose;
use Moose::Util 'does_role';

{
    package foo;
    use Moose;
    use namespace::autoclean;
    use MooseX::AbstractMethod;

    requires 'one';
}
{
    package bar;
    use Moose;

    extends 'foo';

    has one => (is => 'ro');
}


with_immutable {

    meta_ok('foo');

    with_immutable {

        meta_ok('bar');
        isa_ok(bar->meta->get_method('one'), 'Moose::Meta::Method::Accessor');

    } qw{ bar };

} qw{ foo };

done_testing;