mirror of
https://codeberg.org/cunicu/cunicu.git
synced 2025-12-24 06:18:40 +08:00
selfupdate: move most code into selfupdate package and add missing tests
Signed-off-by: Steffen Vogel <post@steffenvogel.de>
This commit is contained in:
21
pkg/selfupdate/github_test.go
Normal file
21
pkg/selfupdate/github_test.go
Normal file
@@ -0,0 +1,21 @@
|
||||
package selfupdate_test
|
||||
|
||||
import (
|
||||
"context"
|
||||
"time"
|
||||
|
||||
. "github.com/onsi/ginkgo/v2"
|
||||
. "github.com/onsi/gomega"
|
||||
"github.com/stv0g/cunicu/pkg/selfupdate"
|
||||
)
|
||||
|
||||
var _ = Context("github", func() {
|
||||
It("can get latest release", func() {
|
||||
rel, err := selfupdate.GitHubLatestRelease(context.Background())
|
||||
Expect(err).To(Succeed())
|
||||
|
||||
Expect(rel.Version).To(MatchRegexp(`\d+\.\d+\.\d+`))
|
||||
Expect(rel.PublishedAt).To(BeTemporally("<", time.Now()))
|
||||
Expect(len(rel.Assets)).To(BeNumerically(">", 10))
|
||||
})
|
||||
})
|
||||
Reference in New Issue
Block a user