updated some redis client object access code

This commit is contained in:
2010-07-20 02:59:37 +03:00
parent 1daf8613dd
commit ebfdfcabea
2 changed files with 10 additions and 7 deletions

View File

@@ -3,5 +3,8 @@ module Redistat
def db
Redistat.redis
end
def self.db
Redistat.redis
end
end
end

View File

@@ -3,21 +3,21 @@ require "spec_helper"
describe Redistat do
it "should have a valid redis client instance" do
redis.should_not be_nil
db.should_not be_nil
end
it "should be connected to the testing server" do
redis.client.port.should == 8379
redis.client.host.should == "127.0.0.1"
db.client.port.should == 8379
db.client.host.should == "127.0.0.1"
end
it "should be able to set and get data" do
redis.set "hello", "world"
redis.get("hello").should == "world"
redis.del("hello").should be_true
db.set "hello", "world"
db.get("hello").should == "world"
db.del("hello").should be_true
end
def redis
def db
Redistat.redis
end