File: attribute_trait_parameters.t

package info (click to toggle)
libmoose-perl 2.4000-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 7,408 kB
  • sloc: perl: 21,275; ansic: 291; makefile: 10
file content (47 lines) | stat: -rw-r--r-- 948 bytes parent folder | download | duplicates (3)
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
use strict;
use warnings;

use Test::Needs 'Test::Output';  # skip all if not installed
use Test::More;
use Test::Output;

{
    package R;
    use Moose::Role;

    sub method { }
}

{
    package C;
    use Moose;

    ::stderr_is{
        has attr => (
            is => 'ro',
            traits => [
                R => { ignored => 1 },
            ],
        );
    } q{}, 'no warning with foreign parameterized attribute traits';

    ::stderr_is{
        has alias_attr => (
            is => 'ro',
            traits => [
                R => { -alias => { method => 'new_name' } },
            ],
        );
    } q{}, 'no warning with -alias parameterized attribute traits';

    ::stderr_is{
        has excludes_attr => (
            is => 'ro',
            traits => [
                R => { -excludes => ['method'] },
            ],
        );
    } q{}, 'no warning with -excludes parameterized attribute traits';
}

done_testing;