Skip to content

Instantly share code, notes, and snippets.

@j1n3l0
Created August 19, 2020 10:58
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save j1n3l0/093f202ee42e00fb8a480b0ca8de9568 to your computer and use it in GitHub Desktop.
Save j1n3l0/093f202ee42e00fb8a480b0ca8de9568 to your computer and use it in GitHub Desktop.
Override the response to ->isa fot Test2 mock objects
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