Commit | Line | Data |
---|---|---|
6c13ef0d | 1 | use strict; |
2 | use warnings; | |
5bf26510 | 3 | |
4 | use Test::Exception; | |
a28e50e4 | 5 | use Test::More; |
5bf26510 | 6 | |
6dabb7f5 | 7 | { |
5bf26510 | 8 | |
6dabb7f5 | 9 | package FakeBar; |
10 | use Moose::Role; | |
6c13ef0d | 11 | |
6dabb7f5 | 12 | around isa => sub { |
5bf26510 | 13 | my ( $orig, $self, $v ) = @_; |
6dabb7f5 | 14 | return 1 if $v eq 'Bar'; |
5bf26510 | 15 | return $orig->( $self, $v ); |
6dabb7f5 | 16 | }; |
6c13ef0d | 17 | |
6c13ef0d | 18 | package Foo; |
19 | use Moose; | |
6c13ef0d | 20 | |
a28643a3 | 21 | use Test::More; # for $TODO |
6c13ef0d | 22 | |
a28643a3 | 23 | local $TODO = 'UNIVERSAL methods should be wrappable'; |
6c13ef0d | 24 | |
a28643a3 | 25 | ::lives_ok { with 'FakeBar' } 'applied role'; |
26 | ||
27 | my $foo = Foo->new; | |
28 | ::isa_ok $foo, 'Bar'; | |
6dabb7f5 | 29 | } |
a28e50e4 | 30 | |
31 | done_testing; |