Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

Re: How to override a mocked method with Test::MockDBI?

by rir (Vicar)
on Oct 22, 2008 at 16:03 UTC ( [id://718789]=note: print w/replies, xml ) Need Help??


in reply to How to override a mocked method with Test::MockDBI?

Just a wild guess: Don't you need to override the DBI::errstr not the Test::MockDBI::errstr which probably was only used to override the DBI::errstr?

Be well,
rir

Replies are listed 'Best First'.
Re^2: How to override a mocked method with Test::MockDBI?
by andreas1234567 (Vicar) on Oct 23, 2008 at 07:01 UTC
    That is correct, perhaps I was unclear: I want to override DBI::errstr which is overridden by Test::MockDBI::errstr. How can it be done?

    I can always patch MockDBI.pm but can it be done programmatically?

    --
    No matter how great and destructive your problems may seem now, remember, you've probably only seen the tip of them. [1]
      andreas1234567, you were clear. I meant try: *DBI::errstr = sub { return }; Test::MockDBI::errstr does not exist, there is only a errstr-keyed element in an argument to fake_module there.

      Be well,
      rir

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others lurking in the Monastery: (7)
As of 2024-04-19 15:09 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found