refactor: move things to packages

This commit is contained in:
Julian Tölle 2024-08-30 22:47:50 +02:00
parent 44184a77f9
commit 11063b2d2c
32 changed files with 923 additions and 892 deletions

View file

@ -0,0 +1,26 @@
package updater
import (
"fmt"
"testing"
"github.com/stretchr/testify/assert"
)
type updaterTestCase struct {
name string
content string
info ReleaseInfo
want string
wantErr assert.ErrorAssertionFunc
}
func runUpdaterTest(t *testing.T, constructor NewUpdater, tt updaterTestCase) {
t.Helper()
got, err := constructor(tt.info)(tt.content)
if !tt.wantErr(t, err, fmt.Sprintf("Updater(%v, %v)", tt.content, tt.info)) {
return
}
assert.Equalf(t, tt.want, got, "Updater(%v, %v)", tt.content, tt.info)
}