forked from concourse/github-release-resource
-
Notifications
You must be signed in to change notification settings - Fork 0
/
resource_suite_test.go
48 lines (42 loc) · 1.23 KB
/
resource_suite_test.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
package resource_test
import (
"testing"
"github.com/google/go-github/github"
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
)
func TestGithubReleaseResource(t *testing.T) {
RegisterFailHandler(Fail)
RunSpecs(t, "Github 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),
}
}