From: John Napiorkowski Date: Tue, 11 Nov 2008 23:20:28 +0000 (+0000) Subject: added eval carrols bug with sub exporter X-Git-Tag: 0.08^0 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=gitmo%2FMooseX-Types.git;a=commitdiff_plain;h=6974ed9016780ef2f9e8511d91023569c0476e0e added eval carrols bug with sub exporter --- diff --git a/t/14_compatibility-sub-exporter.t b/t/14_compatibility-sub-exporter.t new file mode 100644 index 0000000..b2d2fb3 --- /dev/null +++ b/t/14_compatibility-sub-exporter.t @@ -0,0 +1,20 @@ +BEGIN { + use strict; + use warnings; + use Test::More; + use Test::Exception; + use FindBin; + use lib "$FindBin::Bin/lib"; + + eval "use Sub::Exporter"; + plan $@ + ? ( skip_all => "Tests require Sub::Exporter" ) + : ( tests => 3 ); +} + +use SubExporterCompatibility qw(MyStr); + +ok MyStr->check('aaa'), "Correctly passed"; +ok !MyStr->check([1]), "Correctly fails"; +ok something(), "Found the something method"; + diff --git a/t/lib/SubExporterCompatibility.pm b/t/lib/SubExporterCompatibility.pm new file mode 100644 index 0000000..9456929 --- /dev/null +++ b/t/lib/SubExporterCompatibility.pm @@ -0,0 +1,14 @@ +package SubExporterCompatibility; { + + use MooseX::Types::Moose qw(Str); + use MooseX::Types -declare => [qw(MyStr)]; + use Sub::Exporter -setup => { exports => [ qw(something) ] }; + + subtype MyStr, + as Str; + + sub something { + return 1; + } + +} 1;