Skip to content

Commit

Permalink
fix: more renames
Browse files Browse the repository at this point in the history
Signed-off-by: Carlos A Becker <caarlos0@gmail.com>
  • Loading branch information
caarlos0 committed Feb 4, 2022
1 parent 58b4230 commit e61c04a
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 12 deletions.
2 changes: 1 addition & 1 deletion internal/pipe/aur/aur.go
Expand Up @@ -149,7 +149,7 @@ func doRun(ctx *context.Context, aur config.AUR, cl client.Client) error {
}{
{
name: "PKGBUILD",
tpl: pkgBuildTemplate,
tpl: aurTemplateData,
ext: ".pkgbuild",
kind: artifact.PkgBuild,
},
Expand Down
16 changes: 8 additions & 8 deletions internal/pipe/aur/aur_test.go
Expand Up @@ -88,18 +88,18 @@ func createTemplateData() templateData {
}
}

func TestFullPkgBuild(t *testing.T) {
func TestFullAur(t *testing.T) {
data := createTemplateData()
pkg, err := applyTemplate(context.New(config.Project{
ProjectName: "foo",
}), pkgBuildTemplate, data)
}), aurTemplateData, data)
require.NoError(t, err)

golden.RequireEqual(t, []byte(pkg))
}

func TestPkgBuildSimple(t *testing.T) {
pkg, err := applyTemplate(context.New(config.Project{}), pkgBuildTemplate, createTemplateData())
func TestAurSimple(t *testing.T) {
pkg, err := applyTemplate(context.New(config.Project{}), aurTemplateData, createTemplateData())
require.NoError(t, err)
require.Contains(t, pkg, `# Maintainer: Ciclano <ciclano@example.com>`)
require.Contains(t, pkg, `# Maintainer: Cicrano <cicrano@example.com>`)
Expand Down Expand Up @@ -193,7 +193,7 @@ func TestFullPipe(t *testing.T) {
prepare: func(ctx *context.Context) {
ctx.Config.AURs[0].PrivateKey = ""
},
expectedPublishError: `pkgbuild.private_key is empty`,
expectedPublishError: `aur.private_key is empty`,
},
"key-not-found": {
prepare: func(ctx *context.Context) {
Expand All @@ -211,7 +211,7 @@ func TestFullPipe(t *testing.T) {
prepare: func(ctx *context.Context) {
ctx.Config.AURs[0].GitURL = ""
},
expectedPublishError: `pkgbuild.git_url is empty`,
expectedPublishError: `aur.git_url is empty`,
},
"invalid-ssh-cmd-template": {
prepare: func(ctx *context.Context) {
Expand Down Expand Up @@ -338,7 +338,7 @@ func TestRunPipe(t *testing.T) {
AURs: []config.AUR{
{
License: "MIT",
Description: "A run pipe test pkgbuild and FOO={{ .Env.FOO }}",
Description: "A run pipe test aur and FOO={{ .Env.FOO }}",
Homepage: "https://github.com/goreleaser",
IDs: []string{"foo"},
GitURL: url,
Expand Down Expand Up @@ -731,7 +731,7 @@ func TestKeyPath(t *testing.T) {
})
t.Run("empty", func(t *testing.T) {
result, err := keyPath("")
require.EqualError(t, err, `pkgbuild.private_key is empty`)
require.EqualError(t, err, `aur.private_key is empty`)
require.Equal(t, "", result)
})
}
Expand Down
2 changes: 1 addition & 1 deletion internal/pipe/aur/testdata/TestRunPipe.pkgbuild.golden
Expand Up @@ -3,7 +3,7 @@
pkgname='foo-bin'
pkgver=1.0.1
pkgrel=1
pkgdesc='A run pipe test pkgbuild and FOO=foo_is_bar'
pkgdesc='A run pipe test aur and FOO=foo_is_bar'
url='https://github.com/goreleaser'
arch=('aarch64' 'armv6h' 'armv7h' 'i686' 'x86_64')
license=('MIT')
Expand Down
2 changes: 1 addition & 1 deletion internal/pipe/aur/testdata/TestRunPipe.srcinfo.golden
@@ -1,5 +1,5 @@
pkgbase = foo-bin
pkgdesc = A run pipe test pkgbuild and FOO=foo_is_bar
pkgdesc = A run pipe test aur and FOO=foo_is_bar
pkgver = 1.0.1
pkgrel = 1
url = https://github.com/goreleaser
Expand Down
2 changes: 1 addition & 1 deletion internal/pipe/aur/tmpl.go
Expand Up @@ -24,7 +24,7 @@ type releasePackage struct {
Arch string
}

const pkgBuildTemplate = `# This file was generated by GoReleaser. DO NOT EDIT.
const aurTemplateData = `# This file was generated by GoReleaser. DO NOT EDIT.
{{- range .Maintainers }}
# Maintainer: {{ . }}
Expand Down

0 comments on commit e61c04a

Please sign in to comment.