{"modulePath":"github.com/CubePathInc/cubecli","version":"v1.23.0","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package cmdtest\n\nPackage cmdtest runs a command group against a fake API in tests.\n\n## Types\n\n```go\ntype Request struct {\n\tMethod      string\n\tPath        string // path plus raw query\n\tContentType string\n\tRaw         []byte\n\tBody        interface{} // decoded JSON body, nil when empty or not JSON\n}\n```\nRequest is one call the command sent.\n\n```go\nfunc Last(reqs []Request) Request\n```\nLast returns the last request, or a zero Request.\n\n```go\nfunc Run(t *testing.T, group *cobra.Command, respond Responder, args ...string) (string, []Request, error)\n```\nRun executes \\`\\\u003cgroup\u003e \\\u003cargs...\u003e\\` against a fake API and returns what it printed to stdout and the requests it sent.\n\n```go\nfunc (r Request) Obj() map[string]interface{}\n```\nObj returns the body as a JSON object.\n\n```go\ntype Responder func(method, path string) (status int, body string)\n```\nResponder answers a request; returning \"\" answers {\"detail\":\"ok\"}.\n\n","path":"github.com/CubePathInc/cubecli/internal/cmdtest","name":"cmdtest","synopsis":"Package cmdtest runs a command group against a fake API in tests.","isRedistributable":true}
