Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Keys are not converted to strings #48

Closed
pguillory opened this issue Mar 13, 2013 · 5 comments
Closed

Keys are not converted to strings #48

pguillory opened this issue Mar 13, 2013 · 5 comments
Labels

Comments

@pguillory
Copy link

Redis converts keys to strings, whereas MockRedis does not.

Example:

> r = Redis.new
=> #<Redis client v2.2.2 connected to redis://127.0.0.1:6379/0 (Redis v2.4.10)>
> r.set :x, 1
=> "OK"
> r.get 'x'
=> "1"

> r = MockRedis.new
=> #<MockRedis:0x0000000b0c6ec0...>
> r.set :x, 1
=> "OK"
> r.get 'x'
=> nil
@ascandella
Copy link

@pguillory Good catch. Were you planning on submitting a fix or shall I?

@ascandella
Copy link

Wait a second... this seems to be fixed in 8a78a2d, which I verified locally. What version are you on?

@pguillory
Copy link
Author

Ouch, never mind. We're on 0.2.0.

@pguillory
Copy link
Author

MockRedis 0.6.4 appears to convert keys to strings for #get and #set, but not for #expire and #ttl.

> r = MockRedis.new
=> #<MockRedis:0x0000000b0c6ec0...>
> r.set :x, 1
=> "OK"
> r.get :x
=> "1"
> r.expire :x, 999
=> false
> r.expire 'x', 999
=> true
> r.ttl :x
=> -1
> r.ttl 'x'
=> 942

I guess I'll re-open this ticket rather than create a new one. Aiden, you're welcome to work on it. Otherwise I'll get on it later today. I'll touch base with you before starting.

@pguillory pguillory reopened this Mar 13, 2013
@pguillory
Copy link
Author

Fix will go out in 0.6.5.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants