Sha256: 34061d98179050a0cda0321da31a632c3030d377df765bb743b710791df08f6f

Contents?: true

Size: 665 Bytes

Versions: 2

Compression:

Stored size: 665 Bytes

Contents

# encoding: utf-8
require 'helper'
require 'memcached_mock'

describe 'Encoding' do

  describe 'using a live server' do
    it 'support i18n content' do
      memcached_persistent do |dc|
        key = 'foo'
        utf_key = utf8 = 'ƒ©åÍÎ'

        assert dc.set(key, utf8)
        assert_equal utf8, dc.get(key)

        dc.set(utf_key, utf8)
        assert_equal utf8, dc.get(utf_key)
      end
    end

    it 'support content expiry' do
      memcached_persistent do |dc|
        key = 'foo'
        assert dc.set(key, 'bar', 1)
        assert_equal 'bar', dc.get(key)
        sleep 1.2
        assert_equal nil, dc.get(key)
      end
    end

  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
dalli-2.7.4 test/test_encoding.rb
dalli-2.7.3 test/test_encoding.rb