From bf40fb3565afa2e7bae5675a8a195195a3c3c09e Mon Sep 17 00:00:00 2001 From: Taishi Kasuga Date: Wed, 17 Apr 2024 09:12:59 +0900 Subject: [PATCH] Return an empty array instead of throwing ArgumentError if the transaction is empty in the cluster client --- cluster/test/commands_on_transactions_test.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/cluster/test/commands_on_transactions_test.rb b/cluster/test/commands_on_transactions_test.rb index 0877f4c7..51b9d3d1 100644 --- a/cluster/test/commands_on_transactions_test.rb +++ b/cluster/test/commands_on_transactions_test.rb @@ -24,9 +24,7 @@ def test_multi redis.multi end - assert_raises(ArgumentError) do - redis.multi {} - end + assert_empty(redis.multi {}) assert_equal([1], redis.multi { |r| r.incr('counter') }) end @@ -56,6 +54,8 @@ def test_watch end end + assert_empty(redis.watch('{key}1', '{key}2') {}) + redis.watch('{key}1', '{key}2') do |tx| tx.call('SET', '{key}1', '1') tx.call('SET', '{key}2', '2')