gunstructured

package
v1.0.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 27, 2023 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Package gunstructured provides gomega matchers for using unstructured with the ginkgo and gomega testing libraries:

https://github.com/onsi/gomega https://github.com/onsi/ginkgo

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DataTypeMatcher

type DataTypeMatcher struct {
	// contains filtered or unexported fields
}

DataTypeMatcher is a gomega matcher which tests if a given value represents json data of a given type.

func BeABool

func BeABool() DataTypeMatcher

BeABool returns a gomega matcher which tests if a given value represents a json bool.

func BeAList

func BeAList() DataTypeMatcher

BeAList returns a gomega matcher which tests if a given value represents a json list.

func BeANull

func BeANull() DataTypeMatcher

BeNull returns a gomega matcher which tests if a given value represents json null.

func BeANum

func BeANum() DataTypeMatcher

BeANum returns a gomega matcher which tests if a given value represents a json num.

func BeAString

func BeAString() DataTypeMatcher

BeAnObject returns a gomega matcher which tests if a given value represents a json string.

func BeAnObject

func BeAnObject() DataTypeMatcher

BeAnObject returns a gomega matcher which tests if a given value represents a json object.

func (DataTypeMatcher) FailureMessage

func (m DataTypeMatcher) FailureMessage(actual interface{}) (message string)

FailureMessage constructs a hopefully-helpful error message in the case that the given value is not of the appropriate json type.

func (DataTypeMatcher) Match

func (m DataTypeMatcher) Match(actual interface{}) (success bool, err error)

Match is the gomega function that actually checks if the given value is of the appropriate json type.

func (DataTypeMatcher) NegatedFailureMessage

func (m DataTypeMatcher) NegatedFailureMessage(actual interface{}) (message string)

NegatedFailureMessage constructs a hopefully-helpful error message in the case that the given value is unexpectedly of the appropriate json type.

type HaveJSONKeyMatcher

type HaveJSONKeyMatcher struct {
	// contains filtered or unexported fields
}

HaveJSONKeyMatcher is a gomega matcher which tests if a given value represents a json object containing a particular key.

func HaveJSONKey

func HaveJSONKey(key string) HaveJSONKeyMatcher

HaveJSONKey returns a gomega matcher which tests if a given value represents an unstructured object containing a given `key`.

func HaveYAMLKey

func HaveYAMLKey(key string) HaveJSONKeyMatcher

HaveYAMLKey is exactly like HaveJSONKey

func (HaveJSONKeyMatcher) FailureMessage

func (m HaveJSONKeyMatcher) FailureMessage(actual interface{}) (message string)

FailureMessage constructs a hopefully-helpful error message in the case that the given value does not represent a json object containing the particular key.

func (HaveJSONKeyMatcher) Match

func (m HaveJSONKeyMatcher) Match(actual interface{}) (bool, error)

Match is the gomega function that actually checks if the given value represents a json object containing the particular key.

func (HaveJSONKeyMatcher) NegatedFailureMessage

func (m HaveJSONKeyMatcher) NegatedFailureMessage(actual interface{}) (message string)

NegatedFailureMessage constructs a hopefully-helpful error message in the case that the given value unexpectedly represents a json object containing the particular key.

type HaveJSONPointerMatcher

type HaveJSONPointerMatcher struct {
	// contains filtered or unexported fields
}

HaveJSONPointerMatcher is a gomega matcher which tests if a given value represents a json object containing a particular json pointer.

func HaveJSONPointer

func HaveJSONPointer(p string) HaveJSONPointerMatcher

HaveJSONPointer returns a gomega matcher which tests if a given value represents a json object containing a given json pointer `p`.

For more information on json pointers see https://tools.ietf.org/html/rfc6901

func (HaveJSONPointerMatcher) FailureMessage

func (m HaveJSONPointerMatcher) FailureMessage(actual interface{}) (message string)

FailureMessage constructs a hopefully-helpful error message in the case that the given value does not represent a json object containing the particular pointer.

func (HaveJSONPointerMatcher) Match

func (m HaveJSONPointerMatcher) Match(actual interface{}) (bool, error)

Match is the gomega function that actually checks if the given value represents a json object containing the particular pointer.

func (HaveJSONPointerMatcher) NegatedFailureMessage

func (m HaveJSONPointerMatcher) NegatedFailureMessage(actual interface{}) (message string)

NegatedFailureMessage constructs a hopefully-helpful error message in the case that the given value unexpectedly represents a json object containing the particular pointer.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL