Sha256: 3ee54c17010f739ba364d4a217535a52cf80e4a4456e4babda9ce1e2340b7781

Contents?: true

Size: 881 Bytes

Versions: 1

Compression:

Stored size: 881 Bytes

Contents

require "test_helper"

class BadAdapter < CurlyMustache::Adapters::Abstract; end

class AbstractAdapterTest < ActiveSupport::TestCase
  
  def test_not_implemented
    assert_raise(CurlyMustache::NotImplementedError){ BadAdapter.new(nil) }
    BadAdapter.class_eval do
      def initialize(config); nil; end
    end
    adapter = BadAdapter.new(nil)
    assert_raise(CurlyMustache::NotImplementedError){ adapter.get(1) }
    assert_raise(CurlyMustache::NotImplementedError){ adapter.mget([1, 2]) }
    assert_raise(CurlyMustache::NotImplementedError){ adapter.put(1, "one") }
    assert_raise(CurlyMustache::NotImplementedError){ adapter.delete(1) }
    assert_raise(CurlyMustache::NotImplementedError){ adapter.flush_db }
    assert_raise(CurlyMustache::NotImplementedError){ adapter.lock(1) }
    assert_raise(CurlyMustache::NotImplementedError){ adapter.unlock(1) }
  end
  
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
curly_mustache-0.1.0 test/abstract_adapter_test.rb