1
1
Fork 0
mirror of https://github.com/goreleaser/nfpm synced 2024-06-07 03:16:19 +02:00
nfpm/deb/deb_test.go

31 lines
711 B
Go
Raw Normal View History

2018-01-04 13:31:22 +01:00
package deb
import (
"context"
"testing"
"github.com/caarlos0/pkg"
"github.com/tj/assert"
)
func TestDeb(t *testing.T) {
deb, err := New(context.Background(), pkg.Info{
Name: "foo",
Arch: "amd64",
Depends: []string{
2018-01-04 13:45:22 +01:00
"bash",
2018-01-04 13:31:22 +01:00
},
Description: "Foo does things",
Priority: "extra",
Maintainer: "Carlos A Becker <pkg@carlosbecker.com>",
Version: "1.0.0",
Section: "default",
2018-01-04 13:45:22 +01:00
Homepage: "http://carlosbecker.com",
Vendor: "nope",
2018-01-04 14:36:58 +01:00
}, "/tmp/foo_1.0.0-0.deb")
2018-01-04 13:31:22 +01:00
assert.NoError(t, err)
2018-01-04 13:45:22 +01:00
assert.NoError(t, deb.Add("./testdata/fake", "/usr/local/bin/fake"))
assert.NoError(t, deb.Add("./testdata/whatever.conf", "/etc/fake/fake.conf"))
2018-01-04 13:31:22 +01:00
assert.NoError(t, deb.Close())
}