Documentation
¶
Index ¶
- type AssertCase
- type Assertion
- type AssertionBuilder
- func (a *AssertionBuilder) AppendExitStatusCases(cases []AssertCase)
- func (a *AssertionBuilder) AppendStderrCases(cases []AssertCase)
- func (a *AssertionBuilder) AppendStdoutCases(cases []AssertCase)
- func (a *AssertionBuilder) BuildWithCommand(args []string) (*Assertion, error)
- func (a *AssertionBuilder) BuildWithStdin(stdin string) (*Assertion, error)
- type CLI
- type ContainCase
- type EqualCase
- type NotContainCase
- type NotRegexCase
- type RegexCase
- type Result
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AssertCase ¶
AssertCase represents one assertion case. It can examine and describe the assertion.
func NewContainCase ¶
func NewContainCase(substr string) AssertCase
NewContainCase creates a case to inspect a given string.
func NewEqualCase ¶
func NewEqualCase(want string) AssertCase
NewEqualCase creates a case to inspect a given string.
func NewNotContainCase ¶
func NewNotContainCase(substr string) AssertCase
NewNotContainCase creates a case to inspect a given string.
func NewNotRegexCase ¶
func NewNotRegexCase(pattern string) AssertCase
NewNotRegexCase creates a case to inspect a given string.
func NewRegexCase ¶
func NewRegexCase(pattern string) AssertCase
NewRegexCase creates a case to inspect a given string.
type Assertion ¶
type Assertion struct {
// contains filtered or unexported fields
}
Assertion is the struct that assert the command execution result.
type AssertionBuilder ¶
type AssertionBuilder struct {
// contains filtered or unexported fields
}
AssertionBuilder is the builder that build assertion object. Add a test case to this object to build an assertion.
func (*AssertionBuilder) AppendExitStatusCases ¶
func (a *AssertionBuilder) AppendExitStatusCases(cases []AssertCase)
AppendExitStatusCases append assertion cases to check the exit status code.
func (*AssertionBuilder) AppendStderrCases ¶
func (a *AssertionBuilder) AppendStderrCases(cases []AssertCase)
AppendStderrCases append assertion cases to check the stderr.
func (*AssertionBuilder) AppendStdoutCases ¶
func (a *AssertionBuilder) AppendStdoutCases(cases []AssertCase)
AppendStdoutCases append assertion cases to check the stdout.
func (*AssertionBuilder) BuildWithCommand ¶
func (a *AssertionBuilder) BuildWithCommand(args []string) (*Assertion, error)
BuildWithCommand built assertion form command result.
func (*AssertionBuilder) BuildWithStdin ¶
func (a *AssertionBuilder) BuildWithStdin(stdin string) (*Assertion, error)
BuildWithStdin built assertion form stdin.
type ContainCase ¶
type ContainCase struct {
// contains filtered or unexported fields
}
ContainCase represents one assertion case. It checks if the input contains strings.
func (*ContainCase) Assert ¶
func (c *ContainCase) Assert(input string) bool
Assert inspects case assertion.
type EqualCase ¶
type EqualCase struct {
// contains filtered or unexported fields
}
EqualCase represents one assertion case. It checks that the input and the string are the same.
type NotContainCase ¶
type NotContainCase struct {
// contains filtered or unexported fields
}
NotContainCase represents one assertion case. It checks that the input does not contain strings.
func (*NotContainCase) Assert ¶
func (c *NotContainCase) Assert(input string) bool
Assert inspects case assertion.
func (*NotContainCase) Describe ¶
func (c *NotContainCase) Describe() string
Describe Describes the case.
type NotRegexCase ¶
type NotRegexCase struct {
// contains filtered or unexported fields
}
NotRegexCase represents one assertion case. It checks that the input does not match regex pattern.
func (*NotRegexCase) Assert ¶
func (c *NotRegexCase) Assert(input string) bool
Assert inspects case assertion.
func (*NotRegexCase) Describe ¶
func (c *NotRegexCase) Describe() string
Describe Describes the case.
type RegexCase ¶
type RegexCase struct {
// contains filtered or unexported fields
}
RegexCase represents one assertion case. It checks if the input match regex pattern.
type Result ¶
type Result struct {
// contains filtered or unexported fields
}
Result is the struct that shows assertion result.
func (*Result) ShowDetails ¶
ShowDetails shows the detailed result.