ccache/item_test.go
2013-10-19 20:36:33 +08:00

15 lines
342 B
Go

package ccache
import (
"time"
"testing"
"github.com/karlseguin/gspec"
)
func TestItemPromotability(t *testing.T) {
spec := gspec.New(t)
item := &Item{promoted: time.Now().Add(time.Second * -5)}
spec.Expect(item.shouldPromote(time.Second * -2)).ToEqual(true)
spec.Expect(item.shouldPromote(time.Second * -6)).ToEqual(false)
}