File: distributed_transactions_test.rb

package info (click to toggle)
ruby-redis 3.2.2-1
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 736 kB
  • ctags: 1,128
  • sloc: ruby: 8,149; makefile: 5
file content (32 lines) | stat: -rw-r--r-- 621 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
# encoding: UTF-8

require File.expand_path("helper", File.dirname(__FILE__))

class TestDistributedTransactions < Test::Unit::TestCase

  include Helper::Distributed

  def test_multi_discard
    @foo = nil

    assert_raise Redis::Distributed::CannotDistribute do
      r.multi { @foo = 1 }
    end

    assert_equal nil, @foo

    assert_raise Redis::Distributed::CannotDistribute do
      r.discard
    end
  end

  def test_watch_unwatch
    assert_raise Redis::Distributed::CannotDistribute do
      r.watch("foo")
    end

    assert_raise Redis::Distributed::CannotDistribute do
      r.unwatch
    end
  end
end