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-1.1.0 test/lib/text_caches/cache_base_test.rb
wovnrb-1.0.13 test/lib/text_caches/cache_base_test.rb
wovnrb-1.0.12 test/lib/text_caches/cache_base_test.rb
wovnrb-1.0.11 test/lib/text_caches/cache_base_test.rb
wovnrb-1.0.10 test/lib/text_caches/cache_base_test.rb
wovnrb-1.0.9 test/lib/text_caches/cache_base_test.rb
wovnrb-1.0.8 test/lib/text_caches/cache_base_test.rb
wovnrb-1.0.7 test/lib/text_caches/cache_base_test.rb
wovnrb-1.0.6 test/lib/text_caches/cache_base_test.rb
wovnrb-1.0.5 test/lib/text_caches/cache_base_test.rb
wovnrb-1.0.4 test/lib/text_caches/cache_base_test.rb
wovnrb-1.0.2 test/lib/text_caches/cache_base_test.rb
wovnrb-1.0.1 test/lib/text_caches/cache_base_test.rb
wovnrb-1.0.0 test/lib/text_caches/cache_base_test.rb
wovnrb-0.2.30 test/lib/text_caches/cache_base_test.rb
wovnrb-0.2.29 test/lib/text_caches/cache_base_test.rb
wovnrb-0.2.28 test/lib/text_caches/cache_base_test.rb
wovnrb-0.2.27 test/lib/text_caches/cache_base_test.rb
wovnrb-0.2.26 test/lib/text_caches/cache_base_test.rb
wovnrb-0.2.25 test/lib/text_caches/cache_base_test.rb