File: test_connection_pool.rb

package info (click to toggle)
ruby-dalli 3.2.8-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 684 kB
  • sloc: ruby: 6,552; sh: 20; makefile: 4
file content (21 lines) | stat: -rw-r--r-- 549 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
# frozen_string_literal: true

require_relative '../helper'

describe 'connection pool behavior' do
  MemcachedManager.supported_protocols.each do |p|
    describe "using the #{p} protocol" do
      it 'can masquerade as a connection pool using the with method' do
        memcached_persistent(p) do |dc|
          dc.with { |c| c.set('some_key', 'some_value') }

          assert_equal 'some_value', dc.get('some_key')

          dc.with { |c| c.delete('some_key') }

          assert_nil dc.get('some_key')
        end
      end
    end
  end
end