Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Rubocop test lints - 2022-10 #934

Merged
merged 2 commits into from
Oct 27, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions test/integration/test_pipelined_get.rb
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,30 @@
assert_empty expected_resp
end
end

describe 'pipeline_next_responses' do
it 'raises NetworkError when called before pipeline_response_setup' do
memcached_persistent(p) do |dc|
server = dc.instance_variable_get(:@ring).servers.first
server.request(:pipelined_get, %w[a b])
assert_raises Dalli::NetworkError do
server.pipeline_next_responses
end
end
end

it 'raises NetworkError when called after pipeline_abort' do
memcached_persistent(p) do |dc|
server = dc.instance_variable_get(:@ring).servers.first
server.request(:pipelined_get, %w[a b])
server.pipeline_response_setup
server.pipeline_abort
assert_raises Dalli::NetworkError do
server.pipeline_next_responses
end
end
end
end
end
end
end
20 changes: 0 additions & 20 deletions test/protocol/test_binary.rb
Original file line number Diff line number Diff line change
Expand Up @@ -98,24 +98,4 @@
expect(-> { Dalli::Protocol::Binary.new('my.fqdn.com:11212:abc') }).must_raise Dalli::DalliError
end
end

describe 'pipeline_next_responses' do
subject { Dalli::Protocol::Binary.new('127.0.0.1') }

it 'raises NetworkError when called before pipeline_response_setup' do
assert_raises Dalli::NetworkError do
subject.request(:pipelined_get, %w[a b])
subject.pipeline_next_responses
end
end

it 'raises NetworkError when called after pipeline_abort' do
assert_raises Dalli::NetworkError do
subject.request(:pipelined_get, %w[a b])
subject.pipeline_response_setup
subject.pipeline_abort
subject.pipeline_next_responses
end
end
end
end