mirror of
https://github.com/goreleaser/goreleaser.git
synced 2025-01-06 03:13:48 +02:00
improvements
This commit is contained in:
parent
2dd8bfa93d
commit
3bb337840b
@ -24,11 +24,9 @@ const formulae = `class {{ .Name }} < Formula
|
||||
bin.install "{{ .BinaryName }}"
|
||||
end
|
||||
|
||||
{{ if .Caveats }}
|
||||
def caveats
|
||||
{{ if .Caveats }}def caveats
|
||||
"{{ .Caveats }}"
|
||||
end
|
||||
{{ end }}
|
||||
end{{ end }}
|
||||
end
|
||||
`
|
||||
|
||||
|
@ -4,8 +4,6 @@ import (
|
||||
"testing"
|
||||
|
||||
"github.com/stretchr/testify/assert"
|
||||
"os"
|
||||
"io/ioutil"
|
||||
)
|
||||
|
||||
func TestNameWithDash(t *testing.T) {
|
||||
@ -20,6 +18,22 @@ func TestSimpleName(t *testing.T) {
|
||||
assert.Equal(t, formulaNameFor("binary"), "Binary")
|
||||
}
|
||||
|
||||
var testFormulaeExpected = `class Test < Formula
|
||||
desc "Some desc"
|
||||
homepage "https://google.com"
|
||||
url "https://github.com/caarlos0/test/releases/download/v0.1.3/test_#{%x(uname -s).gsub(/\n/, '')}_#{%x(uname -m).gsub(/\n/, '')}.tar.gz"
|
||||
head "https://github.com/caarlos0/test.git"
|
||||
version "v0.1.3"
|
||||
|
||||
def install
|
||||
bin.install "test"
|
||||
end
|
||||
|
||||
def caveats
|
||||
"Here are some caveats"
|
||||
end
|
||||
end
|
||||
`
|
||||
|
||||
func TestFormulae(t *testing.T) {
|
||||
assert := assert.New(t)
|
||||
@ -33,8 +47,6 @@ func TestFormulae(t *testing.T) {
|
||||
Caveats: "Here are some caveats",
|
||||
})
|
||||
assert.NoError(err)
|
||||
f, err := os.Open("./brew/test_files/test.txt")
|
||||
bts, _ := ioutil.ReadAll(f)
|
||||
assert.NoError(err)
|
||||
assert.Equal(string(bts), out.String())
|
||||
assert.Equal(testFormulaeExpected, out.String())
|
||||
}
|
||||
|
@ -1,17 +0,0 @@
|
||||
class Test < Formula
|
||||
desc "Some desc"
|
||||
homepage "https://google.com"
|
||||
url "https://github.com/caarlos0/test/releases/download/v0.1.3/test_#{%x(uname -s).gsub(/\n/, '')}_#{%x(uname -m).gsub(/\n/, '')}.tar.gz"
|
||||
head "https://github.com/caarlos0/test.git"
|
||||
version "v0.1.3"
|
||||
|
||||
def install
|
||||
bin.install "test"
|
||||
end
|
||||
|
||||
|
||||
def caveats
|
||||
"Here are some caveats"
|
||||
end
|
||||
|
||||
end
|
Loading…
Reference in New Issue
Block a user