Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
kardolus
GitHub Repository: kardolus/chatgpt-cli
Path: blob/main/history/store_test.go
2649 views
1
package history_test
2
3
import (
4
"github.com/kardolus/chatgpt-cli/history"
5
. "github.com/onsi/gomega"
6
"github.com/sclevine/spec"
7
"github.com/sclevine/spec/report"
8
"testing"
9
)
10
11
func TestUnitStore(t *testing.T) {
12
spec.Run(t, "Testing the history store", testStore, spec.Report(report.Terminal{}))
13
}
14
15
func testStore(t *testing.T, when spec.G, it spec.S) {
16
var subject history.Store
17
18
it.Before(func() {
19
RegisterTestingT(t)
20
subject = &history.FileIO{}
21
})
22
23
when("GetThread()", func() {
24
it("should return the thread", func() {
25
thread := "threadName"
26
subject.SetThread(thread)
27
Expect(subject.GetThread()).To(Equal(thread))
28
})
29
})
30
}
31
32