Sha256: fb947c9839f9aea8ca7c3cfc45de2682b6835edfcd700456d1db2795cf78bcfd

Contents?: true

Size: 747 Bytes

Versions: 1

Compression:

Stored size: 747 Bytes

Contents

require File.expand_path("../../spec_helper", __FILE__)

describe RedisRing::Application do

  describe "#shards_hash" do
    before(:each) do
      RedisRing::Shard.any_instance.stubs(:fork_redis_server => stub(:start => true, :stop => true, :running? => true))
      RedisRing::ShardConfig.any_instance.stubs(:save)
      RedisRing::ShardConfig.any_instance.stubs(:alive? => true)

      @application = RedisRing::Application.new(RedisRing::Configuration.new)
      @application.start
    end

    it "should return all shards" do
      shard_hash = @application.shards_hash

      shard_hash[:count].should == @application.configuration.ring_size
      shard_hash[:shards].size.should == @application.configuration.ring_size
    end
  end

end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
redis_ring-0.0.2 spec/redis_ring/application_spec.rb