Mouse::Util::does_role() respects $thing->does() method
[gitmo/Mouse.git] / t / 040_type_constraints / 002_util_type_constraints_export.t
CommitLineData
5a592ad7 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!!!
4use t::lib::MooseCompat;
5
6use strict;
7use warnings;
8
9use Test::More;
10use 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
33done_testing;