mirror of
https://github.com/adnanh/webhook.git
synced 2025-10-04 21:51:02 +00:00
Merge pull request #1 from nopcoder/fix/load-unrecognized-keys
Fix error on unrecognized configuration keys
This commit is contained in:
commit
f90fc7ce77
4 changed files with 49 additions and 13 deletions
|
@ -425,6 +425,7 @@ var hooksLoadFromFileTests = []struct {
|
|||
{"", false, true},
|
||||
// failures
|
||||
{"missing.json", false, false},
|
||||
{"testdata/unrecognized.yaml", false, false},
|
||||
}
|
||||
|
||||
func TestHooksLoadFromFile(t *testing.T) {
|
||||
|
@ -434,6 +435,7 @@ func TestHooksLoadFromFile(t *testing.T) {
|
|||
for _, tt := range hooksLoadFromFileTests {
|
||||
h := &Hooks{}
|
||||
err := h.LoadFromFile(tt.path, tt.asTemplate)
|
||||
t.Log(err)
|
||||
if (err == nil) != tt.ok {
|
||||
t.Errorf(err.Error())
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue