Sha256: e837332c79efa93eb6c3255144c01ffb001fa7f1640878977d025163b87fd3f4
Contents?: true
Size: 1 KB
Versions: 7
Compression:
Stored size: 1 KB
Contents
require File.join(File.dirname(__FILE__), "/../spec_helper") describe "DistributedMarshaledRedis" do before(:each) do @dmr = DistributedMarshaledRedis.new [ {:host => "localhost", :port => "6380", :db => 0}, {:host => "localhost", :port => "6381", :db => 0} ] @rabbit = OpenStruct.new :name => "bunny" @white_rabbit = OpenStruct.new :color => "white" @dmr.marshalled_set "rabbit", @rabbit end after(:all) do @dmr.ring.nodes.each { |server| server.flushdb } end it "should accept connection params" do dmr = DistributedMarshaledRedis.new [ :host => "localhost", :port => "6380", :db => "1" ] dmr.ring.should have(1).node mr = dmr.ring.nodes.first mr.to_s.should == "Redis Client connected to localhost:6380 against DB 1" end it "should set an object" do @dmr.marshalled_set "rabbit", @white_rabbit @dmr.marshalled_get("rabbit").should == @white_rabbit end it "should get an object" do @dmr.marshalled_get("rabbit").should == @rabbit end end
Version data entries
7 entries across 7 versions & 1 rubygems