From bd393e1fa5ee3072e3abd0e214eb03a8c3167d24 Mon Sep 17 00:00:00 2001 From: Jean Boussier Date: Tue, 2 Apr 2024 17:03:15 +0200 Subject: [PATCH] Update tests for latest redis-client --- test/lint/streams.rb | 4 ++-- test/redis/connection_test.rb | 10 +++++----- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/test/lint/streams.rb b/test/lint/streams.rb index 624915f58..f23a4ae86 100644 --- a/test/lint/streams.rb +++ b/test/lint/streams.rb @@ -135,7 +135,7 @@ def test_xtrim_with_limit_option assert_equal 1, redis.xtrim('s1', 0, approximate: true, limit: 1) error = assert_raises(Redis::CommandError) { redis.xtrim('s1', 0, limit: 1) } - assert_equal "ERR syntax error, LIMIT cannot be used without the special ~ option", error.message + assert_includes error.message, "ERR syntax error, LIMIT cannot be used without the special ~ option" ensure redis.config(:set, 'stream-node-max-entries', original) end @@ -174,7 +174,7 @@ def test_xtrim_with_invalid_strategy redis.xadd('s1', { f: 'v1' }) error = assert_raises(Redis::CommandError) { redis.xtrim('s1', '1-0', strategy: '') } - assert_equal "ERR syntax error", error.message + assert_includes error.message, "ERR syntax error" end def test_xtrim_with_not_existed_stream diff --git a/test/redis/connection_test.rb b/test/redis/connection_test.rb index 7178c3ccc..368d933a7 100644 --- a/test/redis/connection_test.rb +++ b/test/redis/connection_test.rb @@ -37,27 +37,27 @@ def test_connection_information def test_default_id_with_host_and_port redis = Redis.new(OPTIONS.merge(host: "host", port: "1234", db: 0)) - assert_equal "redis://host:1234/0", redis.connection.fetch(:id) + assert_equal "redis://host:1234", redis.connection.fetch(:id) end def test_default_id_with_host_and_port_and_ssl redis = Redis.new(OPTIONS.merge(host: 'host', port: '1234', db: 0, ssl: true)) - assert_equal "rediss://host:1234/0", redis.connection.fetch(:id) + assert_equal "rediss://host:1234", redis.connection.fetch(:id) end def test_default_id_with_host_and_port_and_explicit_scheme redis = Redis.new(OPTIONS.merge(host: "host", port: "1234", db: 0)) - assert_equal "redis://host:1234/0", redis.connection.fetch(:id) + assert_equal "redis://host:1234", redis.connection.fetch(:id) end def test_default_id_with_path redis = Redis.new(OPTIONS.merge(path: "/tmp/redis.sock", db: 0)) - assert_equal "/tmp/redis.sock/0", redis.connection.fetch(:id) + assert_equal "unix:///tmp/redis.sock", redis.connection.fetch(:id) end def test_default_id_with_path_and_explicit_scheme redis = Redis.new(OPTIONS.merge(path: "/tmp/redis.sock", db: 0)) - assert_equal "/tmp/redis.sock/0", redis.connection.fetch(:id) + assert_equal "/tmp/redis.sock", redis.connection.fetch(:id) end def test_override_id