refactor: move things to packages (#39)

This commit is contained in:
Julian Tölle 2024-08-31 15:23:21 +02:00 committed by GitHub
parent 44184a77f9
commit a0a064d387
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
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)
}