Skip to content

Commit 35a7e82

Browse files
authored
Merge pull request #1261 from casperisfine/update-redis-lcient
Support latest redis-client
2 parents 7cc45e5 + 0060435 commit 35a7e82

File tree

6 files changed

+17
-15
lines changed

6 files changed

+17
-15
lines changed

.github/workflows/test.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ jobs:
2929
strategy:
3030
fail-fast: false
3131
matrix:
32-
ruby: ["3.2", "3.1", "3.0", "2.7", "2.6", "2.5", "jruby-9.3.6.0"]
32+
ruby: ["3.2", "3.1", "3.0", "2.7", "2.6", "jruby-9.3.6.0"]
3333
runs-on: ubuntu-latest
3434
env:
3535
LOW_TIMEOUT: "0.01"
@@ -122,7 +122,7 @@ jobs:
122122
- name: Set up Ruby
123123
uses: ruby/setup-ruby@v1
124124
with:
125-
ruby-version: "2.5"
125+
ruby-version: "2.6"
126126
bundler-cache: true
127127
- name: Cache local temporary directory
128128
uses: actions/cache@v4
@@ -159,7 +159,7 @@ jobs:
159159
- name: Set up Ruby
160160
uses: ruby/setup-ruby@v1
161161
with:
162-
ruby-version: "2.5"
162+
ruby-version: "2.6"
163163
bundler-cache: true
164164
- name: Cache local temporary directory
165165
uses: actions/cache@v4
@@ -194,7 +194,7 @@ jobs:
194194
- name: Set up Ruby
195195
uses: ruby/setup-ruby@v1
196196
with:
197-
ruby-version: "2.5"
197+
ruby-version: "2.6"
198198
bundler-cache: true
199199
- name: Cache local temporary directory
200200
uses: actions/cache@v4

.rubocop.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
inherit_from: .rubocop_todo.yml
22

33
AllCops:
4-
TargetRubyVersion: 2.5
4+
TargetRubyVersion: 2.6
55

66
Layout/LineLength:
77
Max: 120
@@ -56,6 +56,9 @@ Metrics/PerceivedComplexity:
5656
Style/PercentLiteralDelimiters:
5757
Enabled: false
5858

59+
Style/SlicingWithRange:
60+
Enabled: false
61+
5962
Style/TrailingCommaInArrayLiteral:
6063
Enabled: false
6164

cluster/test/helper.rb

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,8 +72,7 @@ def redis_cluster_mock(commands, options = {})
7272
port = nil
7373

7474
cluster_subcommands = if commands.key?(:cluster)
75-
commands.delete(:cluster)
76-
.to_h { |k, v| [k.to_s.downcase, v] }
75+
commands.delete(:cluster).transform_keys { |k| k.to_s.downcase }
7776
else
7877
{}
7978
end

redis.gemspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ Gem::Specification.new do |s|
4343
s.files = Dir["CHANGELOG.md", "LICENSE", "README.md", "lib/**/*"]
4444
s.executables = `git ls-files -- exe/*`.split("\n").map { |f| File.basename(f) }
4545

46-
s.required_ruby_version = '>= 2.5.0'
46+
s.required_ruby_version = '>= 2.6.0'
4747

4848
s.add_runtime_dependency('redis-client', '>= 0.17.0')
4949
end

test/lint/streams.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ def test_xtrim_with_limit_option
135135

136136
assert_equal 1, redis.xtrim('s1', 0, approximate: true, limit: 1)
137137
error = assert_raises(Redis::CommandError) { redis.xtrim('s1', 0, limit: 1) }
138-
assert_equal "ERR syntax error, LIMIT cannot be used without the special ~ option", error.message
138+
assert_includes error.message, "ERR syntax error, LIMIT cannot be used without the special ~ option"
139139
ensure
140140
redis.config(:set, 'stream-node-max-entries', original)
141141
end
@@ -174,7 +174,7 @@ def test_xtrim_with_invalid_strategy
174174

175175
redis.xadd('s1', { f: 'v1' })
176176
error = assert_raises(Redis::CommandError) { redis.xtrim('s1', '1-0', strategy: '') }
177-
assert_equal "ERR syntax error", error.message
177+
assert_includes error.message, "ERR syntax error"
178178
end
179179

180180
def test_xtrim_with_not_existed_stream

test/redis/connection_test.rb

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -37,27 +37,27 @@ def test_connection_information
3737

3838
def test_default_id_with_host_and_port
3939
redis = Redis.new(OPTIONS.merge(host: "host", port: "1234", db: 0))
40-
assert_equal "redis://host:1234/0", redis.connection.fetch(:id)
40+
assert_equal "redis://host:1234", redis.connection.fetch(:id)
4141
end
4242

4343
def test_default_id_with_host_and_port_and_ssl
4444
redis = Redis.new(OPTIONS.merge(host: 'host', port: '1234', db: 0, ssl: true))
45-
assert_equal "rediss://host:1234/0", redis.connection.fetch(:id)
45+
assert_equal "rediss://host:1234", redis.connection.fetch(:id)
4646
end
4747

4848
def test_default_id_with_host_and_port_and_explicit_scheme
4949
redis = Redis.new(OPTIONS.merge(host: "host", port: "1234", db: 0))
50-
assert_equal "redis://host:1234/0", redis.connection.fetch(:id)
50+
assert_equal "redis://host:1234", redis.connection.fetch(:id)
5151
end
5252

5353
def test_default_id_with_path
5454
redis = Redis.new(OPTIONS.merge(path: "/tmp/redis.sock", db: 0))
55-
assert_equal "/tmp/redis.sock/0", redis.connection.fetch(:id)
55+
assert_equal "unix:///tmp/redis.sock", redis.connection.fetch(:id)
5656
end
5757

5858
def test_default_id_with_path_and_explicit_scheme
5959
redis = Redis.new(OPTIONS.merge(path: "/tmp/redis.sock", db: 0))
60-
assert_equal "/tmp/redis.sock/0", redis.connection.fetch(:id)
60+
assert_equal "unix:///tmp/redis.sock", redis.connection.fetch(:id)
6161
end
6262

6363
def test_override_id

0 commit comments

Comments
 (0)