mirror of
https://github.com/jimeh/redistat.git
synced 2026-02-19 13:26:39 +00:00
updated some redis client object access code
This commit is contained in:
@@ -3,5 +3,8 @@ module Redistat
|
|||||||
def db
|
def db
|
||||||
Redistat.redis
|
Redistat.redis
|
||||||
end
|
end
|
||||||
|
def self.db
|
||||||
|
Redistat.redis
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@@ -3,21 +3,21 @@ require "spec_helper"
|
|||||||
describe Redistat do
|
describe Redistat do
|
||||||
|
|
||||||
it "should have a valid redis client instance" do
|
it "should have a valid redis client instance" do
|
||||||
redis.should_not be_nil
|
db.should_not be_nil
|
||||||
end
|
end
|
||||||
|
|
||||||
it "should be connected to the testing server" do
|
it "should be connected to the testing server" do
|
||||||
redis.client.port.should == 8379
|
db.client.port.should == 8379
|
||||||
redis.client.host.should == "127.0.0.1"
|
db.client.host.should == "127.0.0.1"
|
||||||
end
|
end
|
||||||
|
|
||||||
it "should be able to set and get data" do
|
it "should be able to set and get data" do
|
||||||
redis.set "hello", "world"
|
db.set "hello", "world"
|
||||||
redis.get("hello").should == "world"
|
db.get("hello").should == "world"
|
||||||
redis.del("hello").should be_true
|
db.del("hello").should be_true
|
||||||
end
|
end
|
||||||
|
|
||||||
def redis
|
def db
|
||||||
Redistat.redis
|
Redistat.redis
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user