Skip Menu |

This queue is for tickets about the Test-Mock-Redis CPAN distribution.

Report information
The Basics
Id: 74553
Status: rejected
Priority: 0/
Queue: Test-Mock-Redis

People
Owner: Nobody in particular
Requestors: khedin [...] gmail.com
Cc:
AdminCc:

Bug Information
Severity: Wishlist
Broken in: 0.07
Fixed in: (no value)



Subject: Fake isa() method
Hello again, one of my coworkers has put a $redis->isa('Redis') or die; check into his module's constructor so I had to work around it. I think it would be a nice feature to pretend we're Redis in cases like this (however, what about Redis::hiredis, etc, do the yall fake isa?) Here's my patch in case it's really worth it (though I'll attach a better version later today). diff -ur /usr/local/lib/perl5/site_perl/5.10.1/Test/Mock/Redis.pm /www/lib/Test/Mock/Redis.pm --- /usr/local/lib/perl5/site_perl/5.10.1/Test/Mock/Redis.pm 2011-07-14 11:20:41.000000000 +0400 +++ /www/lib/Test/Mock/Redis.pm 2012-01-31 13:04:59.000000000 +0400 @@ -1059,6 +1059,11 @@ =cut +sub isa { + my ($self, $class) = @_; + return 1 if $class eq 'Redis'; + return $self->SUPER::isa($class); +}; sub _is_list { my ( $self, $key ) = @_;
From: jeff [...] zeroclue.com
On Tue Jan 31 04:20:40 2012, Dallaylaen wrote: Show quoted text
> one of my coworkers has put a > > $redis->isa('Redis') or die; > > check into his module's constructor so I had to work around it. I think > it would be a nice feature to pretend we're Redis in cases like this > (however, what about Redis::hiredis, etc, do the yall fake isa?)
I'm tempted to suggest you should remove the isa check. I'm leery of lying about the fact that the module isn't really the real Redis implementation.
Subject: Re: [rt.cpan.org #74553] Fake isa() method
Date: Tue, 7 Feb 2012 19:16:08 +0400
To: bug-Test-Mock-Redis [...] rt.cpan.org
From: "Konstantin S. Uvarin" <khedin [...] gmail.com>
Приветствую! Show quoted text
> <URL: https://rt.cpan.org/Ticket/Display.html?id=74553 > > > On Tue Jan 31 04:20:40 2012, Dallaylaen wrote:
> > one of my coworkers has put a > > > > $redis->isa('Redis') or die; > > > > check into his module's constructor so I had to work around it. I think > > it would be a nice feature to pretend we're Redis in cases like this > > (however, what about Redis::hiredis, etc, do the yall fake isa?)
> > I'm tempted to suggest you should remove the isa check. I'm leery of lying
about the fact that Show quoted text
> the module isn't really the real Redis implementation.
A valid point. Plus, Redis::hiredis doesn't lie either. So there should be a more thorough check anyway. Please close this ticket then. -- WBR, Konstantin S. Uvarin