Sha256: 1ae42dff75bf2d8c63ddbabe91a9aa4dc456fd1a59f37f83c5cfa79e38fa47a6

Contents?: true

Size: 1.62 KB

Versions: 11

Compression:

Stored size: 1.62 KB

Contents

# encoding: UTF-8

require "helper"
require "lint/sets"

class TestDistributedCommandsOnSets < Test::Unit::TestCase

  include Helper::Distributed
  include Lint::Sets

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

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

  def test_sinter
    assert_raise Redis::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 Redis::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 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

  def test_sunionstore
    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

  def test_sdiff
    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

  def test_sdiffstore
    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
end

Version data entries

11 entries across 11 versions & 3 rubygems

Version Path
redis-3.0.5 test/distributed_commands_on_sets_test.rb
sidekiq-statsd-0.1.1 vendor/ruby/1.9.1/gems/redis-3.0.4/test/distributed_commands_on_sets_test.rb
sidekiq-statsd-0.1.0 vendor/ruby/1.9.1/gems/redis-3.0.4/test/distributed_commands_on_sets_test.rb
redis-3.0.4 test/distributed_commands_on_sets_test.rb
redis-3.0.3 test/distributed_commands_on_sets_test.rb
remq-0.0.4 vendor/bundle/gems/redis-3.0.2/test/distributed_commands_on_sets_test.rb
remq-0.0.3 vendor/bundle/gems/redis-3.0.2/test/distributed_commands_on_sets_test.rb
redis-3.0.2 test/distributed_commands_on_sets_test.rb
redis-3.0.1 test/distributed_commands_on_sets_test.rb
redis-3.0.0 test/distributed_commands_on_sets_test.rb
redis-3.0.0.rc2 test/distributed_commands_on_sets_test.rb