mirror of
https://github.com/goreleaser/goreleaser.git
synced 2025-03-19 20:57:53 +02:00
more cleanups and renames
This commit is contained in:
parent
0498ec3393
commit
0d80c3cc15
@ -1,10 +0,0 @@
|
|||||||
package client
|
|
||||||
|
|
||||||
// TODO fix this
|
|
||||||
// func TestDescription(t *testing.T) {
|
|
||||||
// assert := assert.New(t)
|
|
||||||
// desc := describeRelease("0abf342 some message")
|
|
||||||
// assert.Contains(desc, "0abf342 some message")
|
|
||||||
// assert.Contains(desc, "Automated with @goreleaser")
|
|
||||||
// assert.Contains(desc, "go version go1.")
|
|
||||||
// }
|
|
@ -15,7 +15,7 @@ Automated with @goreleaser
|
|||||||
Built with {{ .GoVersion }}
|
Built with {{ .GoVersion }}
|
||||||
`
|
`
|
||||||
|
|
||||||
func buildBody(ctx *context.Context) (bytes.Buffer, error) {
|
func describeBody(ctx *context.Context) (bytes.Buffer, error) {
|
||||||
var out bytes.Buffer
|
var out bytes.Buffer
|
||||||
bts, err := exec.Command("go", "version").CombinedOutput()
|
bts, err := exec.Command("go", "version").CombinedOutput()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
@ -8,13 +8,13 @@ import (
|
|||||||
"github.com/stretchr/testify/assert"
|
"github.com/stretchr/testify/assert"
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestBody(t *testing.T) {
|
func TestDescribeBody(t *testing.T) {
|
||||||
var assert = assert.New(t)
|
var assert = assert.New(t)
|
||||||
var changelog = "\nfeature1: description\nfeature2: other description"
|
var changelog = "\nfeature1: description\nfeature2: other description"
|
||||||
var ctx = &context.Context{
|
var ctx = &context.Context{
|
||||||
ReleaseNotes: changelog,
|
ReleaseNotes: changelog,
|
||||||
}
|
}
|
||||||
out, err := buildBody(ctx)
|
out, err := describeBody(ctx)
|
||||||
assert.NoError(err)
|
assert.NoError(err)
|
||||||
assert.Contains(out.String(), changelog)
|
assert.Contains(out.String(), changelog)
|
||||||
assert.Contains(out.String(), "Automated with @goreleaser")
|
assert.Contains(out.String(), "Automated with @goreleaser")
|
||||||
@ -31,6 +31,6 @@ func TestGoVersionFails(t *testing.T) {
|
|||||||
var ctx = &context.Context{
|
var ctx = &context.Context{
|
||||||
ReleaseNotes: "changelog",
|
ReleaseNotes: "changelog",
|
||||||
}
|
}
|
||||||
_, err := buildBody(ctx)
|
_, err := describeBody(ctx)
|
||||||
assert.Error(err)
|
assert.Error(err)
|
||||||
}
|
}
|
||||||
|
@ -30,7 +30,7 @@ func doRun(ctx *context.Context, client client.Client) error {
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
log.Println("Creating or updating release", ctx.Git.CurrentTag, "on", ctx.Config.Release.GitHub.String())
|
log.Println("Creating or updating release", ctx.Git.CurrentTag, "on", ctx.Config.Release.GitHub.String())
|
||||||
body, err := buildBody(ctx)
|
body, err := describeBody(ctx)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user