Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery

Re^2: RFC Mocking an Accessor with Test::MockObject

by ait (Friar)
on Aug 16, 2010 at 23:16 UTC ( #855379=note: print w/ replies, xml ) Need Help??

in reply to Re: RFC Mocking an Accessor with Test::MockObject
in thread RFC Mocking an Accessor with Test::MockObject

Yeah well every case is different IMHO. This test code is for a specific component a relatively complex Catalyst Model (that is modeled as an aggregate), so I wanted to test very specific classes that receive complex objects and Catalyst Model instances as well. Creating the actual objects would have been a real pain and I wanted to write unit tests for every single component. I looked into Test::MockObject::Extends but it was more than I needed (and virtually impossible and useless to instantiate the whole model to test such a small class), so I settled for the solution above.

Do you think it's worth a tutorial? Is the title appropriate? I could start the article with your caveat above ;-) ("If you have to mock an accessor, you're probably mocking too much.")

Comment on Re^2: RFC Mocking an Accessor with Test::MockObject
Replies are listed 'Best First'.
Re^3: RFC Mocking an Accessor with Test::MockObject
by chromatic (Archbishop) on Aug 17, 2010 at 01:49 UTC

    I'm always interested in more testing articles, especially for sites like

      See if this makes any sense to publich on the PM Tutorials and ait's scratchpad

      BTW Shouldn't there be a "Testing" section on the Tutorials page?

        Et voilà. Merci. :-)

        What is the sound of Windows? Is it not the sound of a wall upon which people have smashed their heads... all the way through?

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://855379]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others studying the Monastery: (10)
As of 2015-11-25 17:05 GMT
Find Nodes?
    Voting Booth?

    What would be the most significant thing to happen if a rope (or wire) tied the Earth and the Moon together?

    Results (683 votes), past polls