Can someone please provide an example of using set_bound() method from Test::MockObject module?
Can set_bound() method return an instance of Test::MockObject (or any other object for that matter)
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
*“Can set_bound method return an instance of Test::MockObject (or any other object for that matter)”*
Yes. From the source:
*Can someone please provide an example of using set_bound method from Test::MockObject module?*
Why use it? POD states “This is often handier than replacing mock methods”. I guess “handier” is in the eye of the beerholder, but it certainly is a nice shortcut to have available.