Imported Upstream version 0.07
gregor herrmann
12 years ago
8 | 8 |
Fixed Test::Exception dependency
|
9 | 9 |
0.04 Fri Feb 18
|
10 | 10 |
Made error conditions consistent with Redis.pm's behavior
|
|
11 |
0.07 Wed Oct 5
|
|
12 |
Fix for RT-71461, incorrect rename behavior
|
11 | 13 |
|
6 | 6 |
Test::More: 0
|
7 | 7 |
configure_requires:
|
8 | 8 |
Module::Build: 0.36
|
9 | |
generated_by: 'Module::Build version 0.3607'
|
|
9 |
generated_by: 'Module::Build version 0.3624'
|
10 | 10 |
license: perl
|
11 | 11 |
meta-spec:
|
12 | 12 |
url: http://module-build.sourceforge.net/META-spec-v1.4.html
|
|
22 | 22 |
provides:
|
23 | 23 |
Test::Mock::Redis:
|
24 | 24 |
file: lib/Test/Mock/Redis.pm
|
25 | |
version: 0.05
|
|
25 |
version: 0.07
|
26 | 26 |
Test::Mock::Redis::Hash:
|
27 | 27 |
file: lib/Test/Mock/Redis.pm
|
28 | 28 |
Test::Mock::Redis::List:
|
|
40 | 40 |
bugtracker: http://rt.cpan.org/NoAuth/Bugs.html?Dist=Test-Mock-Redis
|
41 | 41 |
license: http://dev.perl.org/licenses/
|
42 | 42 |
repository: http://github.com/jlavallee/Test-Mock-Redis/
|
43 | |
version: 0.05
|
|
43 |
version: 0.07
|
0 | |
# Note: this file was auto-generated by Module::Build::Compat version 0.3607
|
|
0 |
# Note: this file was auto-generated by Module::Build::Compat version 0.3624
|
1 | 1 |
use ExtUtils::MakeMaker;
|
2 | 2 |
WriteMakefile
|
3 | 3 |
(
|
4 | |
'NAME' => 'Test::Mock::Redis',
|
5 | |
'VERSION_FROM' => 'lib/Test/Mock/Redis.pm',
|
6 | |
'PREREQ_PM' => {
|
7 | |
'Scalar::Util' => 0,
|
8 | |
'Test::Exception' => 0,
|
9 | |
'Test::More' => 0
|
10 | |
},
|
11 | |
'INSTALLDIRS' => 'site',
|
12 | |
'EXE_FILES' => [],
|
13 | |
'PL_FILES' => {}
|
14 | |
)
|
|
4 |
'PL_FILES' => {},
|
|
5 |
'INSTALLDIRS' => 'site',
|
|
6 |
'NAME' => 'Test::Mock::Redis',
|
|
7 |
'EXE_FILES' => [],
|
|
8 |
'VERSION_FROM' => 'lib/Test/Mock/Redis.pm',
|
|
9 |
'PREREQ_PM' => {
|
|
10 |
'Test::More' => 0,
|
|
11 |
'Scalar::Util' => 0,
|
|
12 |
'Test::Exception' => 0
|
|
13 |
}
|
|
14 |
)
|
15 | 15 |
;
|
12 | 12 |
|
13 | 13 |
=head1 VERSION
|
14 | 14 |
|
15 | |
Version 0.05
|
|
15 |
Version 0.07
|
16 | 16 |
|
17 | 17 |
=cut
|
18 | 18 |
|
19 | |
our $VERSION = '0.05';
|
|
19 |
our $VERSION = '0.07';
|
20 | 20 |
|
21 | 21 |
=head1 SYNOPSIS
|
22 | 22 |
|
|
47 | 47 |
|
48 | 48 |
It can be used in place of a Redis object for unit testing.
|
49 | 49 |
|
50 | |
If you pass the server to "connect" to, it will be ignored.
|
|
50 |
It accepts the "server" argument, just like Redis.pm's new.
|
51 | 51 |
|
52 | 52 |
=cut
|
53 | 53 |
|
|
312 | 312 |
sub keys :method {
|
313 | 313 |
my ( $self, $match ) = @_;
|
314 | 314 |
|
|
315 |
confess q{[KEYS] ERR wrong number of arguments for 'keys' command} unless defined $match;
|
|
316 |
|
315 | 317 |
# TODO: we're not escaping other meta-characters
|
316 | 318 |
$match =~ s/(?<!\\)\*/.*/g;
|
317 | 319 |
$match =~ s/(?<!\\)\?/.?/g;
|
|
336 | 338 |
confess 'rename to existing key' if $whine && $self->_stash->{$to};
|
337 | 339 |
|
338 | 340 |
$self->_stash->{$to} = $self->_stash->{$from};
|
|
341 |
delete $self->_stash->{$from};
|
339 | 342 |
return 1;
|
340 | 343 |
}
|
341 | 344 |
|
75 | 75 |
|
76 | 76 |
is( $r->get('newfoo'), 'foobar', 'rename worked');
|
77 | 77 |
|
|
78 |
is_deeply([sort $r->keys('*')], [qw/bar baz newfoo/], 'rename removed foo');
|
|
79 |
|
|
80 |
|
|
81 |
throws_ok { $r->keys } qr/^\Q[KEYS] ERR wrong number of arguments for 'keys' command\E/,
|
|
82 |
'keys with no argument complains';
|
|
83 |
|
78 | 84 |
$r->set('foo', 'foobar');
|
79 | 85 |
ok(! $r->renamenx('newfoo', 'foo'), 'renamenx returns false when destination key exists');
|
80 | 86 |
|