Sha256: 053e875ace36c948f5a7b5771afdbfc92776f2efdde65fe0975b18494817dbe9

Contents?: true

Size: 1.67 KB

Versions: 2

Compression:

Stored size: 1.67 KB

Contents

# encoding: UTF-8

require File.expand_path("helper", File.dirname(__FILE__))
require "lint/sets"

class TestDistributedCommandsOnSets < Test::Unit::TestCase

  include Helper::Distributed
  include Lint::Sets

  def test_smove
    assert_raise Redis2::Distributed::CannotDistribute do
      r.sadd "foo", "s1"
      r.sadd "bar", "s2"

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

  def test_sinter
    assert_raise Redis2::Distributed::CannotDistribute do
      r.sadd "foo", "s1"
      r.sadd "foo", "s2"
      r.sadd "bar", "s2"

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

  def test_sinterstore
    assert_raise Redis2::Distributed::CannotDistribute do
      r.sadd "foo", "s1"
      r.sadd "foo", "s2"
      r.sadd "bar", "s2"

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

  def test_sunion
    assert_raise Redis2::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

  def test_sunionstore
    assert_raise Redis2::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

  def test_sdiff
    assert_raise Redis2::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

  def test_sdiffstore
    assert_raise Redis2::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
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
redis2-namespaced-3.0.7.1 test/distributed_commands_on_sets_test.rb
redis2-namespaced-3.0.7 test/distributed_commands_on_sets_test.rb