Documentation
¶
Overview ¶
Package test provides test utilities
Index ¶
- func CheckRequest(t *testing.T, expected, actual *http.Request)
- func Flags(t *testing.T, expected []string, cmd *cobra.Command)
- func NewRequest(t *testing.T, method, fullPath string, body io.Reader) *http.Request
- func Options(cmdFn func() *cobra.Command, ...) func(*testing.T, OptionsTest)
- func ValidateCmdTest(args []string) func(*testing.T, CmdTest)
- type CmdTest
- type OptionsTest
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CheckRequest ¶
CheckRequest compares two request, ignoring the User-Agent header.
func NewRequest ¶
NewRequest wraps httptest.NewRequest, and add reasonable default headers.
func Options ¶
func Options(cmdFn func() *cobra.Command, optsFn func(context.Context, *pflag.FlagSet) (*kouch.Options, error)) func(*testing.T, OptionsTest)
Options returns an options-testing function for use with a testy.Table.
cmdFn must return a new, relevant, *cobra.Command optsFn is the Options function to be tested. It takes a context and flags.
Types ¶
Click to show internal directories.
Click to hide internal directories.