Created
August 19, 2020 10:58
-
-
Save j1n3l0/093f202ee42e00fb8a480b0ca8de9568 to your computer and use it in GitHub Desktop.
Override the response to ->isa fot Test2 mock objects
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use Test2::V0; | |
subtest 'Overriding "isa" on a mock object' => sub { | |
isa_ok( | |
mock( {}, override => [ isa => sub { pop eq 'Foo' } ] ), | |
['Foo'], | |
'should correctly respond to "isa"', | |
); | |
}; | |
done_testing(); | |
=head2 OUTPUT | |
# Seeded srand with seed '20200819' from local date. | |
ok 1 - Overriding "isa" on a mock object { | |
ok 1 - should correctly respond to "isa" | |
1..1 | |
} | |
1..1 | |
=cut |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment