File: | blib/lib/Test/Mocha/Types.pm |
Coverage: | 100.0% |
line | stmt | bran | cond | sub | pod | time | code |
---|---|---|---|---|---|---|---|
1 | package Test::Mocha::Types; | ||||||
2 | # ABSTRACT: Internal type constraints | ||||||
3 | $Test::Mocha::Types::VERSION = '0.61'; | ||||||
4 | use Type::Library | ||||||
5 | 68 | 12558 | -base, | ||||
6 | -declare => qw( | ||||||
7 | Matcher | ||||||
8 | Mock | ||||||
9 | NumRange | ||||||
10 | Slurpy | ||||||
11 | 68 68 | 381921 428 | ); | ||||
12 | |||||||
13 | 68 68 68 | 68032 130812 338 | use Type::Utils -all; | ||||
14 | 68 68 68 | 103913 643771 350 | use Types::Standard 0.008 qw( Dict InstanceOf Num Tuple ); | ||||
15 | |||||||
16 | union Matcher, | ||||||
17 | [ | ||||||
18 | class_type( { class => 'Type::Tiny' } ), | ||||||
19 | class_type( { class => 'Moose::Meta::TypeConstraint' } ), | ||||||
20 | ]; | ||||||
21 | |||||||
22 | class_type Mock, { class => 'Test::Mocha::Mock' }; | ||||||
23 | |||||||
24 | declare NumRange, as Tuple [ Num, Num ], where { $_->[0] < $_->[1] }; | ||||||
25 | |||||||
26 | # this hash structure is created by Types::Standard::slurpy() | ||||||
27 | declare Slurpy, as Dict [ slurpy => InstanceOf ['Type::Tiny'] ]; | ||||||
28 | |||||||
29 | 1; |