mirror of
https://github.com/zeromicro/go-zero.git
synced 2025-01-26 11:28:46 +08:00
24 lines
348 B
Go
24 lines
348 B
Go
|
package util
|
||
|
|
||
|
import (
|
||
|
"os"
|
||
|
"path/filepath"
|
||
|
"testing"
|
||
|
|
||
|
"github.com/stretchr/testify/assert"
|
||
|
)
|
||
|
|
||
|
func TestGetGitHome(t *testing.T) {
|
||
|
homeDir, err := os.UserHomeDir()
|
||
|
if err != nil {
|
||
|
return
|
||
|
}
|
||
|
actual, err := GetGitHome()
|
||
|
if err != nil {
|
||
|
return
|
||
|
}
|
||
|
|
||
|
expected := filepath.Join(homeDir, goctlDir, gitDir)
|
||
|
assert.Equal(t, expected, actual)
|
||
|
}
|