Skip to content

Commit

Permalink
Add tests for using aliased.pm with type signatures.
Browse files Browse the repository at this point in the history
  • Loading branch information
renormalist authored and rafl committed Aug 18, 2009
1 parent 1929314 commit d77e80c
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 0 deletions.
3 changes: 3 additions & 0 deletions t/lib/My/Annoyingly/Long/Name/Space.pm
Original file line number Original file line Diff line number Diff line change
@@ -0,0 +1,3 @@
package My::Annoyingly::Long::Name::Space;
use Moose;
1;
27 changes: 27 additions & 0 deletions t/type_alias.t
Original file line number Original file line Diff line number Diff line change
@@ -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.