Skip to content

Commit 72c4171

Browse files
Fix Rubocop test lints - 2022-10 (#934)
Shifts integration test into appropriate file, ensures we have a memcached instance running, and uses a protocol from that client for the tests.
1 parent 48d594d commit 72c4171

File tree

2 files changed

+24
-20
lines changed

2 files changed

+24
-20
lines changed

test/integration/test_pipelined_get.rb

+24
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,30 @@
7171
assert_empty expected_resp
7272
end
7373
end
74+
75+
describe 'pipeline_next_responses' do
76+
it 'raises NetworkError when called before pipeline_response_setup' do
77+
memcached_persistent(p) do |dc|
78+
server = dc.instance_variable_get(:@ring).servers.first
79+
server.request(:pipelined_get, %w[a b])
80+
assert_raises Dalli::NetworkError do
81+
server.pipeline_next_responses
82+
end
83+
end
84+
end
85+
86+
it 'raises NetworkError when called after pipeline_abort' do
87+
memcached_persistent(p) do |dc|
88+
server = dc.instance_variable_get(:@ring).servers.first
89+
server.request(:pipelined_get, %w[a b])
90+
server.pipeline_response_setup
91+
server.pipeline_abort
92+
assert_raises Dalli::NetworkError do
93+
server.pipeline_next_responses
94+
end
95+
end
96+
end
97+
end
7498
end
7599
end
76100
end

test/protocol/test_binary.rb

-20
Original file line numberDiff line numberDiff line change
@@ -98,24 +98,4 @@
9898
expect(-> { Dalli::Protocol::Binary.new('my.fqdn.com:11212:abc') }).must_raise Dalli::DalliError
9999
end
100100
end
101-
102-
describe 'pipeline_next_responses' do
103-
subject { Dalli::Protocol::Binary.new('127.0.0.1') }
104-
105-
it 'raises NetworkError when called before pipeline_response_setup' do
106-
assert_raises Dalli::NetworkError do
107-
subject.request(:pipelined_get, %w[a b])
108-
subject.pipeline_next_responses
109-
end
110-
end
111-
112-
it 'raises NetworkError when called after pipeline_abort' do
113-
assert_raises Dalli::NetworkError do
114-
subject.request(:pipelined_get, %w[a b])
115-
subject.pipeline_response_setup
116-
subject.pipeline_abort
117-
subject.pipeline_next_responses
118-
end
119-
end
120-
end
121101
end

0 commit comments

Comments
 (0)