merge trunk to pluggable errors
[gitmo/Moose.git] / t / 030_roles / 030_role_parameterized.t
CommitLineData
bca01282 1#!/usr/bin/perl
2
3use strict;
4use warnings;
5
e606ae5f 6use Test::More skip_all => 'The feature this test exercises is not yet written';
bca01282 7use 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
23is_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}