test: fix error messages used in tests for mapstructures
Signed-off-by: Jan Larwig <jan@larwig.com>
This commit is contained in:
parent
b44ecb0b91
commit
a067f8a06f
|
|
@ -278,7 +278,7 @@ redirect_url="http://localhost:4180/oauth2/callback"
|
|||
Entry("with bad legacy configuration", loadConfigurationTableInput{
|
||||
configContent: testCoreConfig + "unknown_field=\"something\"",
|
||||
expectedOptions: func() *options.Options { return nil },
|
||||
expectedErr: errors.New("failed to load legacy options: failed to load config: error unmarshalling config: decoding failed due to the following error(s):\n\n'' has invalid keys: unknown_field"),
|
||||
expectedErr: errors.New("failed to load legacy options: failed to load config: error unmarshalling config: decoding failed due to the following error(s):\n\n'options.LegacyOptions' has invalid keys: unknown_field"),
|
||||
}),
|
||||
Entry("with bad alpha configuration", loadConfigurationTableInput{
|
||||
configContent: testCoreConfig,
|
||||
|
|
@ -290,7 +290,7 @@ redirect_url="http://localhost:4180/oauth2/callback"
|
|||
configContent: testCoreConfig + "unknown_field=\"something\"",
|
||||
alphaConfigContent: testAlphaConfig,
|
||||
expectedOptions: func() *options.Options { return nil },
|
||||
expectedErr: errors.New("failed to load legacy options: failed to load config: error unmarshalling config: decoding failed due to the following error(s):\n\n'' has invalid keys: unknown_field"),
|
||||
expectedErr: errors.New("failed to load legacy options: failed to load config: error unmarshalling config: decoding failed due to the following error(s):\n\n'options.LegacyOptions' has invalid keys: unknown_field"),
|
||||
}),
|
||||
)
|
||||
|
||||
|
|
|
|||
|
|
@ -329,7 +329,7 @@ var _ = Describe("Load", func() {
|
|||
Entry("with an unknown option in the config file", &testOptionsTableInput{
|
||||
configFile: []byte(`unknown_option="foo"`),
|
||||
flagSet: func() *pflag.FlagSet { return testOptionsFlagSet },
|
||||
expectedErr: fmt.Errorf("error unmarshalling config: decoding failed due to the following error(s):\n\n'' has invalid keys: unknown_option"),
|
||||
expectedErr: fmt.Errorf("error unmarshalling config: decoding failed due to the following error(s):\n\n'options.TestOptions' has invalid keys: unknown_option"),
|
||||
// Viper will unmarshal before returning the error, so this is the default output
|
||||
expectedOutput: &TestOptions{
|
||||
StringOption: "default",
|
||||
|
|
|
|||
Loading…
Reference in New Issue