Documentation ¶
Index ¶
- Constants
- Variables
- func NewTestOrder() *dawg.Order
- func TempDB() *cache.DataBase
- func TestAddress() *obj.Address
- type Recorder
- func (r *Recorder) Address() dawg.Address
- func (r *Recorder) Build(use, short string, run cli.Runner) *cli.Command
- func (r *Recorder) CleanUp()
- func (r *Recorder) Clear() (err error)
- func (r *Recorder) ClearBuf()
- func (r *Recorder) Compare(t *testing.T, expected string)
- func (r *Recorder) Config() *cli.Config
- func (r *Recorder) ConfigSetup(b []byte) error
- func (r *Recorder) Contains(s string) bool
- func (r *Recorder) DB() *cache.DataBase
- func (r *Recorder) FreshDB() error
- func (r *Recorder) GlobalOptions() *opts.CliFlags
- func (r *Recorder) Output() io.Writer
- func (r *Recorder) StrEq(s string) bool
- func (r *Recorder) ToApp() (*cache.DataBase, *cli.Config, io.Writer)
- type TestRecorder
Constants ¶
const OrderName = "cmdtest.TestingOrder"
OrderName is the name of all testing orders created by the cmdtest package.
Variables ¶
var TestConfigjson = `` /* 231-byte string literal not displayed */
TestConfigjson data.
Functions ¶
func NewTestOrder ¶ added in v0.0.3
NewTestOrder creates an order for testing.
Types ¶
type Recorder ¶
type Recorder struct { DataBase *cache.DataBase Conf *cli.Config Out *bytes.Buffer // contains filtered or unexported fields }
Recorder is a mock command builder.
func (*Recorder) CleanUp ¶
func (r *Recorder) CleanUp()
CleanUp will cleanup all the the Recorder tempfiles and free all resources.
func (*Recorder) Clear ¶
Clear will clear all data stored by the recorder. This includes reseting the output buffer, opening a fresh database, and resetting the config.
func (*Recorder) ClearBuf ¶
func (r *Recorder) ClearBuf()
ClearBuf will reset the internal output buffer.
func (*Recorder) ConfigSetup ¶
ConfigSetup will set the internal recorder config to be main struct used in the config package.
func (*Recorder) Contains ¶
Contains will return true if s is contained within the output buffer of the Recorder.
func (*Recorder) GlobalOptions ¶ added in v0.0.3
GlobalOptions has the global flags
type TestRecorder ¶ added in v0.0.3
type TestRecorder struct { *Recorder // contains filtered or unexported fields }
TestRecorder is a Recorder that has access to a testing.T
func NewTestRecorder ¶ added in v0.0.3
func NewTestRecorder(t *testing.T) *TestRecorder
NewTestRecorder creates a new TestRecorder
func (*TestRecorder) CleanUp ¶ added in v0.0.3
func (tr *TestRecorder) CleanUp()
CleanUp is a noop for go1.14