matchers

package module
v0.0.0-...-fe3d3e7 Latest Latest
Warning

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

Go to latest
Published: Feb 28, 2023 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Overview

Package matchers provides custom gomega matchers for tests.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FindDocsMatchingYAMLPath

func FindDocsMatchingYAMLPath(yamlString string, pathsWithValues map[string]string) ([]string, error)

FindDocsMatchingYAMLPath finds yaml documents that match all paths with values provided.

func HaveYAMLPath

func HaveYAMLPath(path string) types.GomegaMatcher

HaveYAMLPath searches the *first* document in actual for a path

func HaveYAMLPathWithValue

func HaveYAMLPathWithValue(path string, value interface{}) types.GomegaMatcher

HaveYAMLPathWithValue searches the *first* document in actual for a path with value.

Types

type HaveYAMLPathMatcher

type HaveYAMLPathMatcher struct {
	Path string
}

HaveYAMLPathMatcher is the matcher returned by HaveYAMLPath.

func (*HaveYAMLPathMatcher) FailureMessage

func (matcher *HaveYAMLPathMatcher) FailureMessage(actual interface{}) string

FailureMessage returns a human-readable failure message if Match returns false.

func (*HaveYAMLPathMatcher) Match

func (matcher *HaveYAMLPathMatcher) Match(actual interface{}) (bool, error)

Match returns true and no error if actual has a matching path, else it returns false.

func (*HaveYAMLPathMatcher) NegatedFailureMessage

func (matcher *HaveYAMLPathMatcher) NegatedFailureMessage(actual interface{}) string

NegatedFailureMessage returns a human-readable negated failure message when NotTo Match fails.

type HaveYAMLPathWithValueMatcher

type HaveYAMLPathWithValueMatcher struct {
	Path  string
	Value interface{}
	// contains filtered or unexported fields
}

HaveYAMLPathWithValueMatcher is the Matcher returned by HaveYAMLPathWithValue.

func (*HaveYAMLPathWithValueMatcher) FailureMessage

func (matcher *HaveYAMLPathWithValueMatcher) FailureMessage(actual interface{}) string

FailureMessage returns a human-readable failure message if Match returns false.

func (*HaveYAMLPathWithValueMatcher) Match

func (matcher *HaveYAMLPathWithValueMatcher) Match(actual interface{}) (bool, error)

Match returns true and no error if actual has a matching path with value, else it returns false.

func (*HaveYAMLPathWithValueMatcher) NegatedFailureMessage

func (matcher *HaveYAMLPathWithValueMatcher) NegatedFailureMessage(actual interface{}) string

NegatedFailureMessage returns a human-readable negated failure message when NotTo Match fails.

Jump to

Keyboard shortcuts

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