Mouse::Util::does_role() respects $thing->does() method
[gitmo/Mouse.git] / t / 040_type_constraints / 002_util_type_constraints_export.t
1 #!/usr/bin/perl
2 # This is automatically generated by author/import-moose-test.pl.
3 # DO NOT EDIT THIS FILE. ANY CHANGES WILL BE LOST!!!
4 use t::lib::MooseCompat;
5
6 use strict;
7 use warnings;
8
9 use Test::More;
10 use Test::Exception;
11
12 {
13     package Foo;
14
15     use Mouse::Util::TypeConstraints;
16
17     eval {
18         type MyRef => where { ref($_) };
19     };
20     ::ok( !$@, '... successfully exported &type to Foo package' );
21
22     eval {
23         subtype MyArrayRef => as MyRef => where { ref($_) eq 'ARRAY' };
24     };
25     ::ok( !$@, '... successfully exported &subtype to Foo package' );
26
27     Mouse::Util::TypeConstraints->export_type_constraints_as_functions();
28
29     ::ok( MyRef( {} ), '... Ref worked correctly' );
30     ::ok( MyArrayRef( [] ), '... ArrayRef worked correctly' );
31 }
32
33 done_testing;