Commit | Line | Data |
bca01282 |
1 | #!/usr/bin/perl |
2 | |
3 | use strict; |
4 | use warnings; |
5 | |
e606ae5f |
6 | use Test::More skip_all => 'The feature this test exercises is not yet written'; |
bca01282 |
7 | use Test::Exception; |
8 | |
bca01282 |
9 | |
10 | { |
11 | package Scalar; |
12 | use Moose::Role; |
13 | |
14 | BEGIN { parameter T => { isa => 'Moose::Meta::TypeConstraint' } }; |
15 | |
16 | has 'val' => (is => 'ro', isa => T); |
17 | |
18 | requires 'eq'; |
19 | |
20 | sub not_eq { ! (shift)->eq(shift) } |
21 | } |
22 | |
23 | is_deeply( |
24 | Scalar->meta->parameters, |
25 | { T => { isa => 'Moose::Meta::TypeConstraint' } }, |
26 | '... got the right parameters in the role' |
27 | ); |
28 | |
29 | { |
30 | package Integers; |
31 | use Moose; |
32 | use Moose::Util::TypeConstraints; |
33 | |
34 | with Scalar => { T => find_type_constraint('Int') }; |
35 | |
36 | sub eq { shift == shift } |
37 | } |