Permalink
Browse files

Test WATCH with array argument

  • Loading branch information...
1 parent 46795e7 commit f972523bf60ada304840243a518318b35886d920 @pietern pietern committed Mar 9, 2012
Showing with 20 additions and 0 deletions.
  1. +20 −0 test/transactions_test.rb
View
@@ -150,6 +150,15 @@
assert "s1" == r.get("foo")
end
+test "WATCH with an unmodified key passed as array" do |r|
+ r.watch ["foo", "bar"]
+ r.multi do |multi|
+ multi.set "foo", "s1"
+ end
+
+ assert "s1" == r.get("foo")
+end
+
test "WATCH with a modified key" do |r|
r.watch "foo"
r.set "foo", "s1"
@@ -161,6 +170,17 @@
assert "s1" == r.get("foo")
end
+test "WATCH with a modified key passed as array" do |r|
+ r.watch ["foo", "bar"]
+ r.set "foo", "s1"
+ res = r.multi do |multi|
+ multi.set "foo", "s2"
+ end
+
+ assert nil == res
+ assert "s1" == r.get("foo")
+end
+
test "UNWATCH with a modified key" do |r|
r.watch "foo"
r.set "foo", "s1"

0 comments on commit f972523

Please sign in to comment.