X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2F040_type_constraints%2F002_util_type_constraints_export.t;h=2dff998ed96f73664441bb3449e90b27c431351d;hb=abandoned%2Fname-delegations;hp=70c4a09b540a9fc6aebb3cbe4d31c0e7e9f450d4;hpb=e59a5c292a333cac504b65ebd4bba20b5e98d796;p=gitmo%2FMoose.git diff --git a/t/040_type_constraints/002_util_type_constraints_export.t b/t/040_type_constraints/002_util_type_constraints_export.t index 70c4a09..2dff998 100644 --- a/t/040_type_constraints/002_util_type_constraints_export.t +++ b/t/040_type_constraints/002_util_type_constraints_export.t @@ -3,30 +3,28 @@ use strict; use warnings; -use Test::More tests => 5; +use Test::More; use Test::Exception; -BEGIN { - use_ok('Moose::Util::TypeConstraints', { into => 'Foo' } ); -} - { package Foo; - eval { - type MyRef => where { ref($_) }; - }; - ::ok(!$@, '... successfully exported &type to Foo package'); - - eval { - subtype MyArrayRef - => as MyRef - => where { ref($_) eq 'ARRAY' }; - }; - ::ok(!$@, '... successfully exported &subtype to Foo package'); - - Moose::Util::TypeConstraints->export_type_contstraints_as_functions(); - - ::ok(MyRef({}), '... Ref worked correctly'); - ::ok(MyArrayRef([]), '... ArrayRef worked correctly'); -} \ No newline at end of file + use Moose::Util::TypeConstraints; + + eval { + type MyRef => where { ref($_) }; + }; + ::ok( !$@, '... successfully exported &type to Foo package' ); + + eval { + subtype MyArrayRef => as MyRef => where { ref($_) eq 'ARRAY' }; + }; + ::ok( !$@, '... successfully exported &subtype to Foo package' ); + + Moose::Util::TypeConstraints->export_type_constraints_as_functions(); + + ::ok( MyRef( {} ), '... Ref worked correctly' ); + ::ok( MyArrayRef( [] ), '... ArrayRef worked correctly' ); +} + +done_testing;