Sha256: e0e110d8386ee9cea58d2500c7c713e86b80f9770fb5cb98b2037b0b02a80ce1
Contents?: true
Size: 910 Bytes
Versions: 7
Compression:
Stored size: 910 Bytes
Contents
# encoding: utf-8 require 'helper' require 'memcached_mock' class TestEncoding < Test::Unit::TestCase context 'using a live server' do should 'support i18n content' do memcached do |dc| key = 'foo' bad_key = utf8 = 'ƒ©åÍÎ' assert dc.set(key, utf8) assert_equal utf8, dc.get(key) # keys must be ASCII assert_raise ArgumentError, /illegal character/ do dc.set(bad_key, utf8) end end end should 'support content expiry' do memcached do |dc| key = 'foo' assert dc.set(key, 'bar', 1) assert_equal 'bar', dc.get(key) sleep 2 assert_equal nil, dc.get(key) end end should 'not allow non-ASCII keys' do memcached do |dc| key = 'fooƒ' assert_raise ArgumentError do dc.set(key, 'bar') end end end end end
Version data entries
7 entries across 7 versions & 2 rubygems