-
-
Notifications
You must be signed in to change notification settings - Fork 157
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
85 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -24,11 +24,66 @@ func TestDeb(t *testing.T) { | |
Homepage: "http://carlosbecker.com", | ||
Vendor: "nope", | ||
Files: map[string]string{ | ||
"../testdata/fake": "/usr/local/bin/fake", | ||
"../testdata/fake": "/usr/local/bin/fake", | ||
}, | ||
ConfigFiles: map[string]string{ | ||
"../testdata/whatever.conf": "/etc/fake/fake.conf", | ||
}, | ||
}), | ||
ioutil.Discard, | ||
) | ||
assert.NoError(t, err) | ||
} | ||
|
||
func TestDebFileDoesNotExist(t *testing.T) { | ||
var err = Default.Package( | ||
nfpm.WithDefaults(nfpm.Info{ | ||
Name: "foo", | ||
Arch: "amd64", | ||
Depends: []string{ | ||
"bash", | ||
}, | ||
Description: "Foo does things", | ||
Priority: "extra", | ||
Maintainer: "Carlos A Becker <[email protected]>", | ||
Version: "1.0.0", | ||
Section: "default", | ||
Homepage: "http://carlosbecker.com", | ||
Vendor: "nope", | ||
Files: map[string]string{ | ||
"../testdata/": "/usr/local/bin/fake", | ||
}, | ||
ConfigFiles: map[string]string{ | ||
"../testdata/whatever.confzzz": "/etc/fake/fake.conf", | ||
}, | ||
}), | ||
ioutil.Discard, | ||
) | ||
assert.Error(t, err) | ||
} | ||
|
||
func TestDebNoFiles(t *testing.T) { | ||
var err = Default.Package( | ||
nfpm.WithDefaults(nfpm.Info{ | ||
Name: "foo", | ||
Arch: "amd64", | ||
Depends: []string{ | ||
"bash", | ||
}, | ||
Description: "Foo does things", | ||
Priority: "extra", | ||
Maintainer: "Carlos A Becker <[email protected]>", | ||
Version: "1.0.0", | ||
Section: "default", | ||
Homepage: "http://carlosbecker.com", | ||
Vendor: "nope", | ||
}), | ||
ioutil.Discard, | ||
) | ||
assert.NoError(t, err) | ||
} | ||
|
||
func TestDebNoInfo(t *testing.T) { | ||
var err = Default.Package(nfpm.WithDefaults(nfpm.Info{}), ioutil.Discard) | ||
assert.NoError(t, err) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -36,3 +36,28 @@ func TestRPM(t *testing.T) { | |
) | ||
assert.NoError(t, err) | ||
} | ||
|
||
func TestNoFiles(t *testing.T) { | ||
var err = Default.Package( | ||
nfpm.WithDefaults(nfpm.Info{ | ||
Name: "foo", | ||
Arch: "amd64", | ||
Depends: []string{ | ||
"bash", | ||
}, | ||
Description: "Foo does things", | ||
Priority: "extra", | ||
Maintainer: "Carlos A Becker <[email protected]>", | ||
Version: "1.0.0", | ||
Section: "default", | ||
Homepage: "http://carlosbecker.com", | ||
Vendor: "nope", | ||
License: "MIT", | ||
Bindir: "/usr/local/bin", | ||
Files: map[string]string{}, | ||
ConfigFiles: map[string]string{}, | ||
}), | ||
ioutil.Discard, | ||
) | ||
assert.Error(t, err) | ||
} |