Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Fetching contributors…

Cannot retrieve contributors at this time

33 lines (19 sloc) 0.578 kb
#!/usr/bin/perl
use strict;
use warnings;
use lib 't/lib';
use GenErrorRegex qw< badval_error >;
use Test::More;
use Test::Exception;
{ package Foo::Bar; sub new { bless {}, __PACKAGE__; } }
require MouseRoleTest;
use Method::Signatures;
my $mouse = WithMouseRole->new;
my $foobar = Foo::Bar->new;
func mousey (MouseRole $foo) {}
# positive test
lives_ok { mousey($mouse) } 'Mouse role passes okay';
# negative test
throws_ok { mousey($foobar) } badval_error(undef, foo => MouseRole => $foobar, 'mousey'),
'Mouse role fails when appropriate';
done_testing;
Jump to Line
Something went wrong with that request. Please try again.