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
|
||||
Redistat.redis
|
||||
end
|
||||
def self.db
|
||||
Redistat.redis
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user