Skip Menu |

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

Report information
The Basics
Id: 71461
Status: resolved
Worked: 15 min
Priority: 0/
Queue: Test-Mock-Redis

People
Owner: JLAVALLEE [...] cpan.org
Requestors:
Cc:
AdminCc:

Bug Information
Severity: Normal
Broken in: 0.05
Fixed in: 0.07



Subject: Rename does not remove original key
Here's a sample that does not work as expected: perl -we 'use Test::Mock::Redis; my $red = Test::Mock::Redis->new(); $red->set("foo", 1) ; $red->rename("foo", "bar"); print join ",", $red->keys; ' would print "foo,bar" instead of just "bar". I wrote a patch to fix it.
Subject: test-mock-redis.patch
--- /usr/local/lib/perl5/site_perl/5.10.1/Test/Mock/Redis.pm 2011-07-14 11:20:41.000000000 +0400 +++ - 2011-10-05 11:38:28.021099338 +0400 @@ -337,6 +337,7 @@ confess 'rename to existing key' if $whine && $self->_stash->{$to}; $self->_stash->{$to} = $self->_stash->{$from}; + delete $self->_stash->{$from}; return 1; }
On Wed Oct 05 03:44:05 2011, Dallaylaen wrote: Show quoted text
> Here's a sample that does not work as expected: > > perl -we 'use Test::Mock::Redis; my $red = Test::Mock::Redis->new(); > $red->set("foo", 1) > ; $red->rename("foo", "bar"); print join ",", $red->keys; ' > > would print "foo,bar" instead of just "bar". I wrote a patch to fix it.
Thanks for the bug report! I've just uploaded Test-Mock-Redis-0.07 to PAUSE - it should show up on CPAN soon. You should note that ->keys() requires an argument - if you want all keys returned, - Show quoted text
>keys('*') will do it. I also changed Test::Mock::Redis->keys to require an argument, just as
redis does.
Show quoted text
> You should note that ->keys() requires an argument - if you want all > keys returned, -
> >keys('*') will do it. I also changed Test::Mock::Redis->keys to
> require an argument, just as > redis does.
Yes, I've noticed that yesterday and fixed my code, but the bug was already filed. Thank you for the update!
Um, sorry. I was going just to say "thank you" and not reopen the bug.