Sha256: ba4663bed80e8066725508543b08015303388a7e5173e3fd3733d5f8ad4a2d79

Contents?: true

Size: 1.61 KB

Versions: 2

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

2 entries across 2 versions & 2 rubygems

Version Path
gorsuch-redis-3.0.0.rc1 test/distributed_commands_on_sets_test.rb
redis-3.0.0.rc1 test/distributed_commands_on_sets_test.rb