 	checkperiod: 0
 })
 
+localCacheMaxKeys = new nodeCache({
+	maxKeys: 2
+})
 
 localCacheTTL = new nodeCache({
 	stdTTL: 0.3,

				return

		it "set a key with ttl", () ->
			localCache.set state.key1, state.val, 0.7, (err, res) ->
				should.not.exist err
				true.should.eql res
				ts = localCache.getTtl state.key1
				if state.now < ts < state.now + 300
					throw new Error "Invalid timestamp"
				return
			return

		it "check this key immediately", () ->


		return

	describe "max key amount", () ->
		before () ->
			state =
				key1: randomString(10)
				key2: randomString(10)
				key3: randomString(10)
				value1: randomString(10)
				value2: randomString(10)
				value3: randomString(10)
			return

		it "exceed max key size", () ->
			setKey = localCacheMaxKeys.set(state.key1, state.value1, 0)
			true.should.eql setKey

			setKey2 = localCacheMaxKeys.set(state.key2, state.value2, 0)
			true.should.eql setKey2

			(() -> localCacheMaxKeys.set(state.key3, state.value3, 0)).should.throw({
				name: "ECACHEFULL"
				message: "Cache max key size exceeded"
			})
			return

		it "remove a key and set another one", () ->
			del = localCacheMaxKeys.del(state.key1)
			1.should.eql del

			setKey3 = localCacheMaxKeys.set(state.key3, state.value3, 0)
			true.should.eql setKey3
			return

		return

	describe "correct and incorrect key types", () ->
		describe "number", () ->
			before () ->
