diff --git a/lib/redistat/database.rb b/lib/redistat/database.rb index 46d2502..2d8517c 100644 --- a/lib/redistat/database.rb +++ b/lib/redistat/database.rb @@ -3,5 +3,8 @@ module Redistat def db Redistat.redis end + def self.db + Redistat.redis + end end end \ No newline at end of file diff --git a/spec/_redistat_spec.rb b/spec/_redistat_spec.rb index 7d1630b..26240ab 100644 --- a/spec/_redistat_spec.rb +++ b/spec/_redistat_spec.rb @@ -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