Skip to content

Commit

Permalink
Update tests for latest redis-client
Browse files Browse the repository at this point in the history
  • Loading branch information
byroot committed Apr 2, 2024
1 parent 896ab2d commit bd393e1
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions test/lint/streams.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
10 changes: 5 additions & 5 deletions test/redis/connection_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit bd393e1

Please sign in to comment.