1
0
mirror of https://github.com/goreleaser/goreleaser.git synced 2025-03-17 20:47:50 +02:00

more cleanups and renames

This commit is contained in:
Carlos Alexandro Becker 2017-04-19 17:12:12 -03:00
parent 0498ec3393
commit 0d80c3cc15
No known key found for this signature in database
GPG Key ID: E61E2F7DC14AB940
4 changed files with 5 additions and 15 deletions

View File

@ -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.")
// }

View File

@ -15,7 +15,7 @@ Automated with @goreleaser
Built with {{ .GoVersion }}
`
func buildBody(ctx *context.Context) (bytes.Buffer, error) {
func describeBody(ctx *context.Context) (bytes.Buffer, error) {
var out bytes.Buffer
bts, err := exec.Command("go", "version").CombinedOutput()
if err != nil {

View File

@ -8,13 +8,13 @@ import (
"github.com/stretchr/testify/assert"
)
func TestBody(t *testing.T) {
func TestDescribeBody(t *testing.T) {
var assert = assert.New(t)
var changelog = "\nfeature1: description\nfeature2: other description"
var ctx = &context.Context{
ReleaseNotes: changelog,
}
out, err := buildBody(ctx)
out, err := describeBody(ctx)
assert.NoError(err)
assert.Contains(out.String(), changelog)
assert.Contains(out.String(), "Automated with @goreleaser")
@ -31,6 +31,6 @@ func TestGoVersionFails(t *testing.T) {
var ctx = &context.Context{
ReleaseNotes: "changelog",
}
_, err := buildBody(ctx)
_, err := describeBody(ctx)
assert.Error(err)
}

View File

@ -30,7 +30,7 @@ func doRun(ctx *context.Context, client client.Client) error {
return nil
}
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 {
return err
}