| 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 | 56 | 12525 | -base, | ||||
| 6 | -declare => qw( | ||||||
| 7 | Matcher | ||||||
| 8 | Mock | ||||||
| 9 | NumRange | ||||||
| 10 | Slurpy | ||||||
| 11 | 56 56 | 381909 354 | ); | ||||
| 12 | |||||||
| 13 | 56 56 56 | 58770 108870 279 | use Type::Utils -all; | ||||
| 14 | 56 56 56 | 88725 643611 309 | 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; | ||||||