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

Re: changing object's methods at runtime

by IlyaM (Parson)
on May 21, 2003 at 13:51 UTC ( #259719=note: print w/replies, xml ) Need Help??

in reply to changing object's methods at runtime

If you need to fake Apache request object for test purposes you may find it is much easier to use mock objects (i.e. Test::MockObject) instead of Apache::FakeRequest as you have more control over fake request object. See Automated software testing: emulation of interfaces using Test::MockObject for example.

Ilya Martynov,
Quality Perl Programming and Unix Support UK managed @ offshore prices -
Personal website -

  • Comment on Re: changing object's methods at runtime

Replies are listed 'Best First'.
Testing mod_perl handlers [was Re: changing object's methods at runtime]
by ViceRaid (Chaplain) on May 21, 2003 at 14:03 UTC

    Thanks Ilya

    Actually, I started off with Test::MockObject to fake the request, but there was a lot of methods I needed to mock and that's a bit laborious. The other reason is that Apache::Request conveniently fills out all the Apache::Constants, eg, Apache::Contants::FORBIDDEN which otherwise need to be set manually as they're unavailable when running outside mod_perl.

    But having tried it both ways now ;), there's really not much in it.

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://259719]
Corion idly wonders if there is a way to produce ordered .yml files. I want to accept YAML for a configuration file format, but I also want to generate (for debugging/start) a sample configuration file from the current configuration.
[Corion]: Ideally, that configuration file would have some order of the keys, but I'm not sure whether/how YAML supports ordered output.
[Corion]: Basically I have this metadata and generating a purposeful example is much better if the output is ordered in the same way the documentation is ordered

How do I use this? | Other CB clients
Other Users?
Others rifling through the Monastery: (9)
As of 2017-01-16 12:00 GMT
Find Nodes?
    Voting Booth?
    Do you watch meteor showers?

    Results (149 votes). Check out past polls.