Create update_test.go
This commit is contained in:
parent
74f2ebfa57
commit
31d313c6a9
1 changed files with 26 additions and 0 deletions
26
internal/repositories/update_test.go
Normal file
26
internal/repositories/update_test.go
Normal file
|
|
@ -0,0 +1,26 @@
|
||||||
|
package repositories_test
|
||||||
|
|
||||||
|
import (
|
||||||
|
"slices"
|
||||||
|
"testing"
|
||||||
|
|
||||||
|
"git-repo-updater/internal/utils"
|
||||||
|
)
|
||||||
|
|
||||||
|
func TestIsIgnoredRepo(t *testing.T) {
|
||||||
|
ignored := []string{"~/Code/skip-me"}
|
||||||
|
repoPath := "/home/opdavies/Code/skip-me"
|
||||||
|
|
||||||
|
var expandedIgnored []string
|
||||||
|
|
||||||
|
for _, path := range ignored {
|
||||||
|
e, _ := utils.ExpandPath(path)
|
||||||
|
expandedIgnored = append(expandedIgnored, e)
|
||||||
|
}
|
||||||
|
|
||||||
|
isIgnored := slices.Contains(expandedIgnored, repoPath)
|
||||||
|
|
||||||
|
if !isIgnored {
|
||||||
|
t.Errorf("expected repo %s to be ignored, but it was not", repoPath)
|
||||||
|
}
|
||||||
|
}
|
||||||
Loading…
Add table
Add a link
Reference in a new issue