spec/hiredis_spec.rb in em-synchrony-1.0.0 vs spec/hiredis_spec.rb in em-synchrony-1.0.1

- old
+ new

@@ -9,10 +9,33 @@ EventMachine.stop end end + it "should work with compact connect syntax" do + EventMachine.synchrony do + redis = EM::Hiredis.connect + + redis.set('a', 'bar') + redis.get('a').should == 'bar' + + EM.stop + end + end + + it "should work with manual db select" do + EventMachine.synchrony do + redis = EM::Hiredis.connect 'redis://127.0.0.1:6379' + redis.select(0) + + redis.set('a', 'baz') + redis.get('a').should == 'baz' + + EM.stop + end + end + it "should get/set records synchronously" do EventMachine.synchrony do redis = EM::Hiredis::Client.connect redis.set('a', 'foo') @@ -24,10 +47,10 @@ end it "should incr/decr key synchronously" do EventMachine.synchrony do redis = EM::Hiredis::Client.connect - redis.delete('key') + redis.del('key') redis.incr('key') redis.get('key').to_i.should == 1 redis.decr('key')