Documentation ¶
Index ¶
- type Expectation
- type ExpectedValue
- func (e *ExpectedValue) At(index interface{}) Expectation
- func (e *ExpectedValue) Be() Expectation
- func (e *ExpectedValue) DoesNot() Expectation
- func (e *ExpectedValue) Empty()
- func (e *ExpectedValue) Eq(expected interface{})
- func (e *ExpectedValue) Equal(expected interface{})
- func (e *ExpectedValue) EqualTo(expected interface{})
- func (e *ExpectedValue) Equals(expected interface{})
- func (e *ExpectedValue) False()
- func (e *ExpectedValue) HasLength(expected int)
- func (e *ExpectedValue) HaveLength(expected int)
- func (e *ExpectedValue) Is() Expectation
- func (e *ExpectedValue) IsNot() Expectation
- func (e *ExpectedValue) Match(pattern string)
- func (e *ExpectedValue) Matches(pattern string)
- func (e *ExpectedValue) Nil()
- func (e *ExpectedValue) Not() Expectation
- func (e *ExpectedValue) Should() Expectation
- func (e *ExpectedValue) To() Expectation
- func (e *ExpectedValue) True()
- type Fault
- func (f *Fault) At(index interface{}) Expectation
- func (f *Fault) Be() Expectation
- func (f *Fault) DoesNot() Expectation
- func (f *Fault) Empty()
- func (f *Fault) Eq(expected interface{})
- func (f *Fault) Equal(expected interface{})
- func (f *Fault) EqualTo(expected interface{})
- func (f *Fault) Equals(expected interface{})
- func (f *Fault) False()
- func (f *Fault) HasLength(expected int)
- func (f *Fault) HaveLength(expected int)
- func (f *Fault) Is() Expectation
- func (f *Fault) IsNot() Expectation
- func (f *Fault) Match(pattern string)
- func (f *Fault) Matches(pattern string)
- func (f *Fault) Nil()
- func (f *Fault) Not() Expectation
- func (f *Fault) Should() Expectation
- func (f *Fault) To() Expectation
- func (f *Fault) True()
- type Negation
- func (not *Negation) At(index interface{}) Expectation
- func (not *Negation) Be() Expectation
- func (not *Negation) DoesNot() Expectation
- func (not *Negation) Empty()
- func (not *Negation) Eq(given interface{})
- func (not *Negation) Equal(given interface{})
- func (not *Negation) EqualTo(given interface{})
- func (not *Negation) Equals(given interface{})
- func (not *Negation) False()
- func (not *Negation) HasLength(given int)
- func (not *Negation) HaveLength(given int)
- func (not *Negation) Is() Expectation
- func (not *Negation) IsNot() Expectation
- func (not *Negation) Match(pattern string)
- func (not *Negation) Matches(pattern string)
- func (not *Negation) Nil()
- func (not *Negation) Not() Expectation
- func (not *Negation) Should() Expectation
- func (not *Negation) To() Expectation
- func (not *Negation) True()
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Expectation ¶
type Expectation interface { To() Expectation Be() Expectation Is() Expectation Should() Expectation Not() Expectation IsNot() Expectation DoesNot() Expectation At(index interface{}) Expectation Nil() True() False() Empty() HasLength(expected int) HaveLength(expected int) Eq(expected interface{}) Equal(expected interface{}) Equals(expected interface{}) EqualTo(expected interface{}) Match(pattern string) Matches(pattern string) }
Expectation about a value or behavior
func Value ¶
func Value(t *testing.T, actual interface{}) Expectation
Value returns a new value-based Expectation
type ExpectedValue ¶
ExpectedValue is an expectation on a realized value
func (*ExpectedValue) At ¶ added in v0.0.2
func (e *ExpectedValue) At(index interface{}) Expectation
At returns an expectation about the element at the given index
func (*ExpectedValue) Be ¶
func (e *ExpectedValue) Be() Expectation
Be returns the current expectation
func (*ExpectedValue) DoesNot ¶
func (e *ExpectedValue) DoesNot() Expectation
DoesNot is equivalent to Not()
func (*ExpectedValue) Eq ¶
func (e *ExpectedValue) Eq(expected interface{})
Eq is equivalent to Equals()
func (*ExpectedValue) Equal ¶
func (e *ExpectedValue) Equal(expected interface{})
Equal is equivalent to Equals()
func (*ExpectedValue) EqualTo ¶
func (e *ExpectedValue) EqualTo(expected interface{})
EqualTo is equivalent to Equals()
func (*ExpectedValue) Equals ¶
func (e *ExpectedValue) Equals(expected interface{})
Equals asserts equality to an expected value
func (*ExpectedValue) HasLength ¶
func (e *ExpectedValue) HasLength(expected int)
HasLength asserts the value is an array with a given length
func (*ExpectedValue) HaveLength ¶
func (e *ExpectedValue) HaveLength(expected int)
HaveLength is equivalent to HasLength()
func (*ExpectedValue) Is ¶
func (e *ExpectedValue) Is() Expectation
Is returns the current expectation
func (*ExpectedValue) IsNot ¶
func (e *ExpectedValue) IsNot() Expectation
IsNot is equivalent to Not()
func (*ExpectedValue) Match ¶
func (e *ExpectedValue) Match(pattern string)
Match is equivalent to Matches()
func (*ExpectedValue) Matches ¶
func (e *ExpectedValue) Matches(pattern string)
Matches asserts that the value matches a given pattern
func (*ExpectedValue) Not ¶
func (e *ExpectedValue) Not() Expectation
Not negates the current expectation
func (*ExpectedValue) Should ¶
func (e *ExpectedValue) Should() Expectation
Should returns the current expectation
func (*ExpectedValue) To ¶
func (e *ExpectedValue) To() Expectation
To returns the current expectation
type Fault ¶
Fault is an expectation that always results in an error
func (*Fault) At ¶ added in v0.0.2
func (f *Fault) At(index interface{}) Expectation
At returns the current expectation
func (*Fault) DoesNot ¶
func (f *Fault) DoesNot() Expectation
DoesNot returns the current expectation
func (*Fault) EqualTo ¶
func (f *Fault) EqualTo(expected interface{})
EqualTo always results in an error
func (*Fault) Equals ¶
func (f *Fault) Equals(expected interface{})
Equals always results in an error
func (*Fault) HaveLength ¶
HaveLength always results in an error
type Negation ¶
Negation is a negated expectation
func (*Negation) At ¶ added in v0.0.2
func (not *Negation) At(index interface{}) Expectation
At returns an negated expectation about the element at the given index
func (*Negation) DoesNot ¶
func (not *Negation) DoesNot() Expectation
DoesNot is equivalent to Not()
func (*Negation) Equal ¶
func (not *Negation) Equal(given interface{})
Equal is equivalent to Equals()
func (*Negation) EqualTo ¶
func (not *Negation) EqualTo(given interface{})
EqualTo is equivalent to Equals()
func (*Negation) Equals ¶
func (not *Negation) Equals(given interface{})
Equals asserts inequality to a given value
func (*Negation) HaveLength ¶
HaveLength is equivalent to HasLength()
func (*Negation) Should ¶
func (not *Negation) Should() Expectation
Should returns the current Expectation