Drop automatic message prefix from command errors (#384)
This commit is contained in:
+4
-4
@@ -38,7 +38,7 @@ func TestBindTo(t *testing.T) {
|
||||
|
||||
p, err := New(&cli, BindTo(impl("foo"), (*iface)(nil)))
|
||||
assert.NoError(t, err)
|
||||
err = callMethod("method", reflect.ValueOf(impl("??")), reflect.ValueOf(method), p.bindings)
|
||||
err = callFunction(reflect.ValueOf(method), p.bindings)
|
||||
assert.NoError(t, err)
|
||||
assert.Equal(t, "foo", saw)
|
||||
}
|
||||
@@ -58,8 +58,8 @@ func TestInvalidCallback(t *testing.T) {
|
||||
|
||||
p, err := New(&cli, BindTo(impl("foo"), (*iface)(nil)))
|
||||
assert.NoError(t, err)
|
||||
err = callMethod("method", reflect.ValueOf(impl("??")), reflect.ValueOf(method), p.bindings)
|
||||
assert.EqualError(t, err, `kong.impl.method(): return value of func(kong.iface) string must implement "error"`)
|
||||
err = callFunction(reflect.ValueOf(method), p.bindings)
|
||||
assert.EqualError(t, err, `return value of func(kong.iface) string must implement "error"`)
|
||||
}
|
||||
|
||||
type zrror struct{}
|
||||
@@ -83,7 +83,7 @@ func TestCallbackCustomError(t *testing.T) {
|
||||
|
||||
p, err := New(&cli, BindTo(impl("foo"), (*iface)(nil)))
|
||||
assert.NoError(t, err)
|
||||
err = callMethod("method", reflect.ValueOf(impl("??")), reflect.ValueOf(method), p.bindings)
|
||||
err = callFunction(reflect.ValueOf(method), p.bindings)
|
||||
assert.NoError(t, err)
|
||||
assert.Equal(t, "foo", saw)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user