Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func HavingField ¶
HavingField succeeds if the actual value is a struct of exactly type StructT and it has a field with the given name. If an expected value (raw value or matcher) is provided, the field's value must match it too.
Example:
Expect(result).To(be_struct.HavingField[TestStruct]("Field1", "hello1"))
Expect(result).To(be_struct.HavingField[TestStruct]("Field2"))
This is the generic, compile-time-typed variant: it pins the struct type at the call site. For everyday assertions prefer the root be.HaveField — it needs no type parameter, and supports dotted paths and "Method()" specs. The naming wobble (HaveField vs HavingField) is deliberate: it separates the default matcher from this typed variant.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.