From a07865cd3737dc18d3d600b5f89f68f5c8bab546 Mon Sep 17 00:00:00 2001 From: Jim Myhrberg Date: Sat, 24 Jul 2010 11:16:23 +0300 Subject: [PATCH] spec for checking if Redis test server supports hashes --- spec/_redistat_spec.rb | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/spec/_redistat_spec.rb b/spec/_redistat_spec.rb index b28057e..b2899a8 100644 --- a/spec/_redistat_spec.rb +++ b/spec/_redistat_spec.rb @@ -21,6 +21,15 @@ describe Redistat do db.del("hello").should be_true end + it "should be able to store hashes to Redis" do + db.hset("key", "field", "1") + db.hget("key", "field").should == "1" + db.hincrby("key", "field", 1) + db.hget("key", "field").should == "2" + db.hincrby("key", "field", -1) + db.hget("key", "field").should == "1" + end + def db Redistat.redis end