Browse files

Fixed cleanup method call in hiredis spec

The previous call to #delete was actually raising an error, because the
method name is #del. Unless you had previously set the "key" key, the
test would have passed. Setting it to a string would expose the
following error:

            undefined method `to_i' for #<RuntimeError:0x007fd4e1842660>

Fixed by using the right cleanup method. Does anyone know why the bad
call to #delete didn't raise an error?
  • Loading branch information...
1 parent 1bb3af1 commit 00b33b8aeb507cb16981c65f52c634596a3e23b9 @jwarchol jwarchol committed Jan 13, 2012
Showing with 1 addition and 1 deletion.
  1. +1 −1 spec/hiredis_spec.rb
@@ -49,7 +49,7 @@
it "should incr/decr key synchronously" do
EventMachine.synchrony do
redis = EM::Hiredis::Client.connect
- redis.delete('key')
+ redis.del('key')
redis.get('key').to_i.should == 1

0 comments on commit 00b33b8

Please sign in to comment.