Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight

Re: How to test a Moose Role?

by Nomad (Pilgrim)
on Aug 08, 2011 at 12:11 UTC ( #919202=note: print w/replies, xml ) Need Help??

in reply to How to test a Moose Role?

One way is to write a minimal class that consumes the role and then write tests against the class.

Also, you might want to test your consuming classes anyway, because, you need to make sure they are consumed in the way you expect, and you might have different return values or arguments that need to be tested. For example, I have a project where two different classes consume a role. One class returns 'undef' on failure and another has to, because of what the class actually does, return '' on failure. These situations are similar but different and need to be tested appropriately.

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://919202]
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others chilling in the Monastery: (3)
As of 2018-05-27 18:06 GMT
Find Nodes?
    Voting Booth?