mockValidate is a helper function that returns a specified Output and error for testing.
(out *output.Output, err error)
| 41 | |
| 42 | // mockValidate is a helper function that returns a specified Output and error for testing. |
| 43 | func mockValidate(out *output.Output, err error) InputValidationFunc { |
| 44 | return func(_ context.Context, fpath string, _ policy.Policy, _ bool) (*output.Output, error) { |
| 45 | // This function ignores the actual file content and always returns the provided output and error. |
| 46 | return out, err |
| 47 | } |
| 48 | } |
| 49 | |
| 50 | func setUpValidateInputCmd(validate InputValidationFunc, fs afero.Fs) (*cobra.Command, *bytes.Buffer) { |
| 51 | // Create the parent validate command to get the persistent flags |
no outgoing calls
no test coverage detected