1
1
mirror of https://github.com/goreleaser/nfpm synced 2024-09-23 06:41:18 +02:00
nfpm/rpm/rpm_test.go

41 lines
815 B
Go
Raw Normal View History

2018-02-03 20:42:56 +01:00
package rpm
import (
2018-02-05 02:28:36 +01:00
"os"
2018-02-03 20:42:56 +01:00
"testing"
2018-02-05 02:53:22 +01:00
"github.com/goreleaser/nfpm"
2018-02-05 03:54:03 +01:00
"github.com/stretchr/testify/assert"
2018-02-03 20:42:56 +01:00
)
func TestRPM(t *testing.T) {
2018-02-05 02:28:36 +01:00
f, err := os.Create("foo.rpm")
assert.NoError(t, err)
err = Default.Package(
2018-02-05 02:53:22 +01:00
nfpm.Info{
2018-02-05 02:28:36 +01:00
Name: "foo",
Arch: "amd64",
Platform: "linux",
2018-02-03 20:42:56 +01:00
Depends: []string{
"bash",
},
Description: "Foo does things",
Priority: "extra",
Maintainer: "Carlos A Becker <pkg@carlosbecker.com>",
Version: "1.0.0",
Section: "default",
Homepage: "http://carlosbecker.com",
Vendor: "nope",
2018-02-05 00:00:20 +01:00
License: "MIT",
2018-02-03 20:42:56 +01:00
Files: map[string]string{
2018-02-05 02:36:02 +01:00
"../testdata/fake": "/usr/local/bin/fake",
2018-02-05 00:19:00 +01:00
},
ConfigFiles: map[string]string{
2018-02-05 02:36:02 +01:00
"../testdata/whatever.conf": "/etc/fake/fake.conf",
2018-02-03 20:42:56 +01:00
},
},
2018-02-05 02:28:36 +01:00
f,
2018-02-03 20:42:56 +01:00
)
assert.NoError(t, err)
}