Permalink
Browse files

Add tests for using aliased.pm with type signatures.

  • Loading branch information...
renormalist authored and rafl committed Aug 17, 2009
1 parent 1929314 commit d77e80c899cf98e143ec530aa5a0cbb5a40f6168
Showing with 30 additions and 0 deletions.
  1. +3 −0 t/lib/My/Annoyingly/Long/Name/Space.pm
  2. +27 −0 t/type_alias.t
@@ -0,0 +1,3 @@
+package My::Annoyingly::Long::Name::Space;
+use Moose;
+1;
View
@@ -0,0 +1,27 @@
+use strict;
+use warnings;
+use Test::More;
+use Test::Exception;
+
+use FindBin;
+use lib "$FindBin::Bin/lib";
+
+{
+ package TestClass;
+ use Moose;
+ use MooseX::Method::Signatures;
+
+ use aliased 'My::Annoyingly::Long::Name::Space', 'Shortcut';
+
+ eval 'method alias_sig (Shortcut $affe) { }';
+ ::ok(!$@, 'method with aliased type constraint compiles');
+}
+
+my $o = TestClass->new;
+my $affe = My::Annoyingly::Long::Name::Space->new;
+
+lives_ok(sub {
+ $o->alias_sig($affe);
+}, 'calling method with aliased type constraint');
+
+done_testing;

0 comments on commit d77e80c

Please sign in to comment.