示例#1
0
	. "github.com/pivotal/gumshoe/repos/ginkgo"
	. "github.com/pivotal/gumshoe/repos/gomega"
	"github.com/pivotal/gumshoe/trackerapi/store"
)

var _ = Describe("FileStore", func() {

	var (
		fileStore *store.FileStore
		tempFile  *os.File
	)

	BeforeEach(func() {
		tempFile, _ = ioutil.TempFile("", ".tracker")
		fileStore = store.NewFileStore()
		fileStore.SetFilePath(tempFile.Name())
	})

	AfterEach(func() {
		fileStore.Clear()
	})

	It("stores arbitrary key-value pairs", func() {
		key := "Ryan Gosling"
		value := "Hey girl, I heard you like reading... Maybe you could read my lips."
		fileStore.Set(key, value)
		retVal, _ := fileStore.Get(key)
		Expect(retVal).To(Equal(value))
	})
示例#2
0
文件: client.go 项目: pivotal/gumshoe
func NewConfiguration() Configuration {
	return Configuration{
		Store:    store.NewFileStore(),
		Resolver: request.NewDefaultResolver(),
	}
}