Sha256: 67d15d910f2cde6ce886cd5db9e46ce5117c41bc8254ad7a0f3c2d5ddd286966

Contents?: true

Size: 714 Bytes

Versions: 39

Compression:

Stored size: 714 Bytes

Contents

require 'wovnrb/text_caches/cache_base'
require 'minitest/autorun'

class CacheBaseTest < Minitest::Test
  def setup
    Wovnrb::CacheBase.reset_cache
  end

  def test_build
    cache = Wovnrb::CacheBase.build({})
    assert_equal('Wovnrb::MemoryCache', cache.class.name)
  end

  def test_build_with_invalid_strategy
    assert_raises RuntimeError do
      Wovnrb::CacheBase.build({strategy: :invalid})
    end
  end

  def test_set_and_get_single
    Wovnrb::CacheBase.set_single({})
    cache = Wovnrb::CacheBase.get_single
    assert_equal('Wovnrb::MemoryCache', cache.class.name)
  end

  def test_get_single_without_set
    assert_raises RuntimeError do
      Wovnrb::CacheBase.get_single
    end
  end
end

Version data entries

39 entries across 39 versions & 1 rubygems

Version Path
wovnrb-0.2.24 test/lib/text_caches/cache_base_test.rb
wovnrb-0.2.23 test/lib/text_caches/cache_base_test.rb
wovnrb-0.2.22 test/lib/text_caches/cache_base_test.rb
wovnrb-0.2.21 test/lib/text_caches/cache_base_test.rb
wovnrb-0.2.07.1 test/lib/text_caches/cache_base_test.rb
wovnrb-0.2.20 test/lib/text_caches/cache_base_test.rb
wovnrb-0.2.19 test/lib/text_caches/cache_base_test.rb
wovnrb-0.2.18 test/lib/text_caches/cache_base_test.rb
wovnrb-0.2.17 test/lib/text_caches/cache_base_test.rb
wovnrb-0.2.16 test/lib/text_caches/cache_base_test.rb
wovnrb-0.2.15 test/lib/text_caches/cache_base_test.rb
wovnrb-0.2.14 test/lib/text_caches/cache_base_test.rb
wovnrb-0.2.13 test/lib/text_caches/cache_base_test.rb
wovnrb-0.2.12 test/lib/text_caches/cache_base_test.rb
wovnrb-0.2.11 test/lib/text_caches/cache_base_test.rb
wovnrb-0.2.10 test/lib/text_caches/cache_base_test.rb
wovnrb-0.2.09 test/lib/text_caches/cache_base_test.rb
wovnrb-0.2.08 test/lib/text_caches/cache_base_test.rb
wovnrb-0.2.07 test/lib/text_caches/cache_base_test.rb