ccache/item_test.go
Karl Seguin 751266c34a Remove Value interface, cache now works against interface{} with the
expiry specified on a Set.

Get no longer returns expired items

Items can now be deleted
2013-10-30 20:18:51 +08:00

17 lines
401 B
Go

package ccache
import (
"testing"
"github.com/karlseguin/gspec"
)
func TestItemPromotability(t *testing.T) {
spec := gspec.New(t)
item := &Item{promotions: -1}
spec.Expect(item.shouldPromote(5)).ToEqual(true)
spec.Expect(item.shouldPromote(5)).ToEqual(false)
item.promotions = 4
spec.Expect(item.shouldPromote(5)).ToEqual(true)
spec.Expect(item.shouldPromote(5)).ToEqual(false)
}