Commit | Line | Data |
---|---|---|
6c13ef0d | 1 | use strict; |
2 | use warnings; | |
5bf26510 | 3 | |
b10dde3a | 4 | use Test::Fatal; |
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 | |
5af4bafe | 21 | use Test::More; |
6c13ef0d | 22 | |
b10dde3a | 23 | ::is( ::exception { with 'FakeBar' }, undef, 'applied role' ); |
a28643a3 | 24 | |
25 | my $foo = Foo->new; | |
8596646e | 26 | ::isa_ok( $foo, 'Bar' ); |
6dabb7f5 | 27 | } |
a28e50e4 | 28 | |
29 | done_testing; |