MCPcopy Index your code
hub / github.com/git-bug/git-bug / newTestEnv

Function newTestEnv

commands/execenv/env_testing.go:85–102  ·  view source on GitHub ↗
(t *testing.T, isTerminal bool)

Source from the content-addressed store, hash-verified

83}
84
85func newTestEnv(t *testing.T, isTerminal bool) *Env {
86 repo := repository.CreateGoGitTestRepo(t, false)
87
88 backend, err := cache.NewRepoCacheNoEvents(repo)
89 require.NoError(t, err)
90
91 t.Cleanup(func() {
92 backend.Close()
93 })
94
95 return &Env{
96 Repo: repo,
97 Backend: backend,
98 In: &TestIn{Buffer: &bytes.Buffer{}, forceIsTerminal: isTerminal},
99 Out: &TestOut{Buffer: &bytes.Buffer{}, forceIsTerminal: isTerminal},
100 Err: &TestOut{Buffer: &bytes.Buffer{}, forceIsTerminal: isTerminal},
101 }
102}

Callers 2

NewTestEnvFunction · 0.85
NewTestEnvTerminalFunction · 0.85

Calls 3

CreateGoGitTestRepoFunction · 0.92
NewRepoCacheNoEventsFunction · 0.92
CloseMethod · 0.65

Tested by

no test coverage detected