Begin working on tests

This commit is contained in:
Ed
2018-12-19 18:00:25 -05:00
parent 7cab700694
commit 9eb0ab0a0f
9 changed files with 893 additions and 1459 deletions

View File

@@ -3,46 +3,21 @@ package resource_test
import (
"testing"
"github.com/google/go-github/github"
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
"github.com/xanzy/go-gitlab"
)
func TestGithubReleaseResource(t *testing.T) {
RegisterFailHandler(Fail)
RunSpecs(t, "Github Release Resource Suite")
RunSpecs(t, "GitLab Release Resource Suite")
}
func newRepositoryRelease(id int, version string) *github.RepositoryRelease {
return &github.RepositoryRelease{
TagName: github.String(version),
Draft: github.Bool(false),
Prerelease: github.Bool(false),
ID: github.Int(id),
}
}
func newPreReleaseRepositoryRelease(id int, version string) *github.RepositoryRelease {
return &github.RepositoryRelease{
TagName: github.String(version),
Draft: github.Bool(false),
Prerelease: github.Bool(true),
ID: github.Int(id),
}
}
func newDraftRepositoryRelease(id int, version string) *github.RepositoryRelease {
return &github.RepositoryRelease{
TagName: github.String(version),
Draft: github.Bool(true),
Prerelease: github.Bool(false),
ID: github.Int(id),
}
}
func newDraftWithNilTagRepositoryRelease(id int) *github.RepositoryRelease {
return &github.RepositoryRelease{
Draft: github.Bool(true),
Prerelease: github.Bool(false),
ID: github.Int(id),
func newTag(name, sha string) *gitlab.Tag {
return &gitlab.Tag{
Commit: &gitlab.Commit{
ID: *gitlab.String(sha),
},
Name: *gitlab.String(name),
}
}