File: test_authentication.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 (19 lines) | stat: -rw-r--r-- 526 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
# frozen_string_literal: true

require_relative '../helper'

describe 'authentication' do
  describe 'using the meta protocol' do
    let(:username) { SecureRandom.hex(5) }
    it 'raises an error if the username is set' do
      err = assert_raises Dalli::DalliError do
        memcached_persistent(:meta, 21_345, '', username: username) do |dc|
          dc.flush
          dc.set('key1', 'abcd')
        end
      end

      assert_equal 'Authentication not supported for the meta protocol.', err.message
    end
  end
end