in reply to Re^2: Where can I buy an $r with which to test Apache2::Cookie?
in thread Where can I buy an $r with which to test Apache2::Cookie?

If I can't create the $r in a "pure" context then I should be able to mock it, that's exactly what Test::MockObject is for (and very good at).
Aha, right. Then why don't you just do it? fake the $r with Test::MockObject?

--shmem

_($_=" "x(1<<5)."?\n".q·/)Oo.  G°\        /
                              /\_¯/(q    /
----------------------------  \__(m.====·.(_("always off the crowd"))."·
");sub _{s./.($e="'Itrs `mnsgdq Gdbj O`qkdq")=~y/"-y/#-z/;$e.e && print}
  • Comment on Re^3: Where can I buy an $r with which to test Apache2::Cookie?

Replies are listed 'Best First'.
Re^4: Where can I buy an $r with which to test Apache2::Cookie?
by frostman (Beadle) on Feb 11, 2008 at 05:33 UTC

    You're absolutely right, and thanks for making the point.

    I slept on it and realized it actually can't (hopefully) be that hard to figure out what Apache2::Cookie needs from the $r and mock that. And then I would at least have a leg to stand on in my complaining, and maybe even a patch for the docs. :-)