tj_thompson has asked for the wisdom of the Perl Monks concerning the following question:
Hello monks. I have a rather simple question regarding testing and roles. After my reference books and Google have failed me I come to you expert types :)
Assume I have an object $object that I'm playing with in one manner or another. I want to be able to fake that it implements some role such that $object->does('Some::Role') returns true for testing purposes. What is the best way to accomplish this?
EDIT: fixed a grammar typo
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Testing with Roles
by chromatic (Archbishop) on Dec 17, 2011 at 03:52 UTC | |
|
Re: Testing with Roles
by educated_foo (Vicar) on Dec 17, 2011 at 06:57 UTC | |
by tj_thompson (Monk) on Dec 19, 2011 at 22:10 UTC | |
|
Re: Testing with Roles
by tobyink (Canon) on Dec 17, 2011 at 09:52 UTC |