/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. require File.expand_path("helper", File.dirname(__FILE__))
  3. require "lint/blocking_commands"
  4. class TestDistributedBlockingCommands < Test::Unit::TestCase
  5. include Helper::Distributed
  6. include Lint::BlockingCommands
  7. def test_blpop_raises
  8. assert_raises(Redis::Distributed::CannotDistribute) do
  9. r.blpop(["foo", "bar"])
  10. end
  11. end
  12. def test_blpop_raises_with_old_prototype
  13. assert_raises(Redis::Distributed::CannotDistribute) do
  14. r.blpop("foo", "bar", 0)
  15. end
  16. end
  17. def test_brpop_raises
  18. assert_raises(Redis::Distributed::CannotDistribute) do
  19. r.brpop(["foo", "bar"])
  20. end
  21. end
  22. def test_brpop_raises_with_old_prototype
  23. assert_raises(Redis::Distributed::CannotDistribute) do
  24. r.brpop("foo", "bar", 0)
  25. end
  26. end
  27. def test_brpoplpush_raises
  28. assert_raises(Redis::Distributed::CannotDistribute) do
  29. r.brpoplpush("foo", "bar")
  30. end
  31. end
  32. def test_brpoplpush_raises_with_old_prototype
  33. assert_raises(Redis::Distributed::CannotDistribute) do
  34. r.brpoplpush("foo", "bar", 0)
  35. end
  36. end
  37. end