PageRenderTime 22ms CodeModel.GetById 10ms app.highlight 9ms RepoModel.GetById 1ms app.codeStats 0ms

/vendor/bundle/jruby/2.1/gems/redis-3.0.7/test/distributed_blocking_commands_test.rb

https://github.com/delowong/logstash
Ruby | 46 lines | 36 code | 9 blank | 1 comment | 0 complexity | c31b1befb8aad2c94148b98f688816ce MD5 | raw file
 1# encoding: UTF-8
 2
 3require File.expand_path("helper", File.dirname(__FILE__))
 4require "lint/blocking_commands"
 5
 6class TestDistributedBlockingCommands < Test::Unit::TestCase
 7
 8  include Helper::Distributed
 9  include Lint::BlockingCommands
10
11  def test_blpop_raises
12    assert_raises(Redis::Distributed::CannotDistribute) do
13      r.blpop(["foo", "bar"])
14    end
15  end
16
17  def test_blpop_raises_with_old_prototype
18    assert_raises(Redis::Distributed::CannotDistribute) do
19      r.blpop("foo", "bar", 0)
20    end
21  end
22
23  def test_brpop_raises
24    assert_raises(Redis::Distributed::CannotDistribute) do
25      r.brpop(["foo", "bar"])
26    end
27  end
28
29  def test_brpop_raises_with_old_prototype
30    assert_raises(Redis::Distributed::CannotDistribute) do
31      r.brpop("foo", "bar", 0)
32    end
33  end
34
35  def test_brpoplpush_raises
36    assert_raises(Redis::Distributed::CannotDistribute) do
37      r.brpoplpush("foo", "bar")
38    end
39  end
40
41  def test_brpoplpush_raises_with_old_prototype
42    assert_raises(Redis::Distributed::CannotDistribute) do
43      r.brpoplpush("foo", "bar", 0)
44    end
45  end
46end