Sha256: ab8d827cf6823345494e7b838dbc697cae08179172521279e9ad39944748d931

Contents?: true

Size: 1.61 KB

Versions: 54

Compression:

Stored size: 1.61 KB

Contents

# encoding: UTF-8

require File.expand_path("./helper", File.dirname(__FILE__))
require "redis/distributed"

setup do
  log = StringIO.new
  init Redis::Distributed.new(NODES, :logger => ::Logger.new(log))
end

load './test/lint/sets.rb'

test "SMOVE" do |r|
  assert_raise Redis::Distributed::CannotDistribute do
    r.sadd "foo", "s1"
    r.sadd "bar", "s2"

    r.smove("foo", "bar", "s1")
  end
end

test "SINTER" do |r|
  assert_raise Redis::Distributed::CannotDistribute do
    r.sadd "foo", "s1"
    r.sadd "foo", "s2"
    r.sadd "bar", "s2"

    r.sinter("foo", "bar")
  end
end

test "SINTERSTORE" do |r|
  assert_raise Redis::Distributed::CannotDistribute do
    r.sadd "foo", "s1"
    r.sadd "foo", "s2"
    r.sadd "bar", "s2"

    r.sinterstore("baz", "foo", "bar")
  end
end

test "SUNION" do |r|
  assert_raise Redis::Distributed::CannotDistribute do
    r.sadd "foo", "s1"
    r.sadd "foo", "s2"
    r.sadd "bar", "s2"
    r.sadd "bar", "s3"

    r.sunion("foo", "bar")
  end
end

test "SUNIONSTORE" do |r|
  assert_raise Redis::Distributed::CannotDistribute do
    r.sadd "foo", "s1"
    r.sadd "foo", "s2"
    r.sadd "bar", "s2"
    r.sadd "bar", "s3"

    r.sunionstore("baz", "foo", "bar")
  end
end

test "SDIFF" do |r|
  assert_raise Redis::Distributed::CannotDistribute do
    r.sadd "foo", "s1"
    r.sadd "foo", "s2"
    r.sadd "bar", "s2"
    r.sadd "bar", "s3"

    r.sdiff("foo", "bar")
  end
end

test "SDIFFSTORE" do |r|
  assert_raise Redis::Distributed::CannotDistribute do
    r.sadd "foo", "s1"
    r.sadd "foo", "s2"
    r.sadd "bar", "s2"
    r.sadd "bar", "s3"

    r.sdiffstore("baz", "foo", "bar")
  end
end

Version data entries

54 entries across 54 versions & 7 rubygems

Version Path
classiccms-0.3.5 vendor/bundle/gems/redis-2.2.2/test/distributed_commands_on_sets_test.rb
classiccms-0.3.4 vendor/bundle/gems/redis-2.2.2/test/distributed_commands_on_sets_test.rb
classiccms-0.3.3 vendor/bundle/gems/redis-2.2.2/test/distributed_commands_on_sets_test.rb
classiccms-0.3.2 vendor/bundle/gems/redis-2.2.2/test/distributed_commands_on_sets_test.rb
classiccms-0.3.1 vendor/bundle/gems/redis-2.2.2/test/distributed_commands_on_sets_test.rb
classiccms-0.3.0 vendor/bundle/gems/redis-2.2.2/test/distributed_commands_on_sets_test.rb
resque-pool-0.3.0 vendor/bundle/ruby/1.8/gems/redis-2.2.2/test/distributed_commands_on_sets_test.rb
resque-pool-0.3.0.beta.2 vendor/bundle/ruby/1.8/gems/redis-2.2.2/test/distributed_commands_on_sets_test.rb
yam-redis-with-retries-2.2.2.1 test/distributed_commands_on_sets_test.rb
vanity-1.7.1 vendor/ruby/1.9.1/gems/redis-2.2.2/test/distributed_commands_on_sets_test.rb
redis-2.2.2 test/distributed_commands_on_sets_test.rb
redis-2.2.1 test/distributed_commands_on_sets_test.rb
modesty-0.1.0 vendor/redis-rb/test/distributed_commands_on_sets_test.rb
redis-2.2.0 test/distributed_commands_on_sets_test.rb