MCPcopy Create free account
hub / github.com/diillson/chatcli / TestGetShellHistory_FileNotExist

Function TestGetShellHistory_FileNotExist

utils/shell_utils_test.go:104–117  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

102}
103
104func TestGetShellHistory_FileNotExist(t *testing.T) {
105 setupShellTest(t, "bash", "")
106
107 // Sobrescreve o mock de os.Stat para simular arquivo não encontrado
108 originalStat := osStat
109 osStat = func(name string) (os.FileInfo, error) {
110 return nil, os.ErrNotExist
111 }
112 t.Cleanup(func() { osStat = originalStat })
113
114 _, err := GetShellHistory()
115 assert.Error(t, err)
116 assert.Contains(t, err.Error(), "arquivo de histórico não encontrado")
117}

Callers

nothing calls this directly

Calls 4

setupShellTestFunction · 0.85
GetShellHistoryFunction · 0.85
ErrorMethod · 0.65
CleanupMethod · 0.45

Tested by

no test coverage detected