>>> "Stevan Little" <[EMAIL PROTECTED]> 02/02/08 11:24 AM
>>>
> On Feb 1, 2008, at 2:57 PM, Noel Maddy wrote:
> 
> > However, I'm used to using Devel::Cover for code coverage,
> > and it seems to skip code in Moose's attribute default coderefs.
> 
> Well, it is possible that it is actually checking that code since  
> Devel::Cover hooks into perl at runtime to check code coverage,  
> however it cannot report on it since it cannot match it to the actual 

> source. This is a common issue with code generation modules like
Moose.

Yeah -- but moving the code into a 'builder' method, like Matt
suggested, takes care of it elegantly -- or should I say moosishly? ;)

> > I assume it would also skip code in MooseX::Method definitions?
> 
> Actually, I think Anders worked really hard to get Devel::Cover to  
> work with MX::Method, although I don't know what the final outcome
was.

It's working for me - I used MX::Method for my build method, and
Devel::Cover (0.61) hits it properly.

> > Is there any way to get Devel::Cover to do code coverage on
> > the Moose coderefs? Or is there another code coverage tool
> > that works with Moose?
> 
> No, there isn't anything but Devel::Cover as far as I know. However,  
> to be completely honest, the code that Moose generates has already  
> been tested pretty thoroughly in the Moose test suite and it's  
> behavior verified. So you really shouldn't need to worry about having 

> to re-test it yourself. Personally, when I test code-coverage on my  
> Moose based modules, I tend to just look to make sure I have coverage 

> on *my* methods and don't worry about the Moose generated stuff.

Agreed - I'm only worrying about my code, and it looks like as long as
I put anything "interesting" into a builder option rather than a default
option, Devel::Cover hits it properly.

Thanks,
Noel


==============================================================================
CONFIDENTIALITY NOTICE: This email contains information from the sender that 
may be CONFIDENTIAL, LEGALLY PRIVILEGED, PROPRIETARY or otherwise protected 
from disclosure. This email is intended for use only by the person or entity to 
whom it is addressed. If you are not the intended recipient, any use, 
disclosure, copying, distribution, printing, or any action taken in reliance on 
the contents of this email, is strictly prohibited. If you received this email 
in error, please contact the sending party by reply email, delete the email 
from your computer system and shred any paper copies.
 
Note to Patients: There are a number of risks you should consider before using 
e-mail to communicate with us. See our Privacy Policy and Henry Ford My Health 
at www.henryford.com for more detailed information. If you do not believe that 
our policy gives you the privacy and security protection you need, do not send 
e-mail or Internet communications to us.

==============================================================================

Reply via email to