Sha256: 0f81d7bf7849fc9c67f268b288aaef0b803e86af297d6105111c4f354422fabd
Contents?: true
Size: 809 Bytes
Versions: 3
Compression:
Stored size: 809 Bytes
Contents
module CacheIncrementDecrementBehavior def test_increment @cache.write('foo', 1, :raw => true) assert_equal 1, @cache.read('foo').to_i assert_equal 2, @cache.increment('foo') assert_equal 2, @cache.read('foo').to_i assert_equal 3, @cache.increment('foo') assert_equal 3, @cache.read('foo').to_i # spymemcached will set zero as default value assert_equal 0, @cache.increment('bar') end def test_decrement @cache.write('foo', 3, :raw => true) assert_equal 3, @cache.read('foo').to_i assert_equal 2, @cache.decrement('foo') assert_equal 2, @cache.read('foo').to_i assert_equal 1, @cache.decrement('foo') assert_equal 1, @cache.read('foo').to_i # spymemcached will set zero as default value assert_equal 0, @cache.decrement('bar') end end
Version data entries
3 entries across 3 versions & 1 rubygems