Sha256: 55ad9713eb90a219a4c352973ce9f7533b4705a94fc9c56e98dc2e663ea70fbc

Contents?: true

Size: 454 Bytes

Versions: 6

Compression:

Stored size: 454 Bytes

Contents

require 'lru_redux'
require 'minitest/autorun'
require 'minitest/pride'

class ThreadSafeCacheTest < MiniTest::Unit::TestCase
  def test_additions
    cache = LruRedux::ThreadSafeCache.new(1000)
    threads = []
    4.times do |t|
      threads << Thread.new do
        250.times do |i|
          cache[i] = "#{t} #{i}"
        end
      end
    end

    threads.each{|t| t.join}
    assert_equal cache.count,250
    assert true, cache.valid?

  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
lru_redux-0.0.6 test/thread_safe_cache_test.rb
lru_redux-0.0.5 test/thread_safe_cache_test.rb
lru_redux-0.0.4 test/thread_safe_cache_test.rb
lru_redux-0.0.3 test/thread_safe_cache_test.rb
lru_redux-0.0.2 test/thread_safe_cache_test.rb
lru_redux-0.0.1 test/thread_safe_cache_test.rb