matchers

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Feb 11, 2022 License: Apache-2.0 Imports: 10 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BeAvailable

func BeAvailable() types.GomegaMatcher

BeAvailable matches if the actual occam.Container is running AND an HTTP request to at least one of its exposed ports completes without error.

func ContainLines

func ContainLines(expected ...interface{}) types.GomegaMatcher

ContainLines matches if all of the 'expected' matchers match with lines (i.e. newline-delimited substrings) in the 'actual' string or fmt.Stringer. Matching lines must appear in the order that the 'expected' matchers are passed.

Types

type BeAvailableMatcher

type BeAvailableMatcher struct {
	Docker occam.Docker
}

func (*BeAvailableMatcher) FailureMessage

func (m *BeAvailableMatcher) FailureMessage(actual interface{}) string

func (*BeAvailableMatcher) Match

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

func (*BeAvailableMatcher) NegatedFailureMessage

func (m *BeAvailableMatcher) NegatedFailureMessage(actual interface{}) string

type ServeMatcher added in v0.1.0

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

func Serve added in v0.1.0

func Serve(expected interface{}) *ServeMatcher

Serve matches if the actual occam.Container is running AND the response from an HTTP request to the container's exposed port matches the 'expected' matcher passed as an argument.

func (*ServeMatcher) FailureMessage added in v0.1.0

func (sm *ServeMatcher) FailureMessage(actual interface{}) (message string)

func (*ServeMatcher) Match added in v0.1.0

func (sm *ServeMatcher) Match(actual interface{}) (success bool, err error)

func (*ServeMatcher) NegatedFailureMessage added in v0.1.0

func (sm *ServeMatcher) NegatedFailureMessage(actual interface{}) (message string)

func (*ServeMatcher) OnPort added in v0.1.0

func (sm *ServeMatcher) OnPort(port int) *ServeMatcher

OnPort sets the container port that is expected to be exposed.

func (*ServeMatcher) WithDocker added in v0.1.0

func (sm *ServeMatcher) WithDocker(docker occam.Docker) *ServeMatcher

WithDocker sets the occam.Docker that the matcher will use to access the 'actual' container's metadata.

func (*ServeMatcher) WithEndpoint added in v0.1.0

func (sm *ServeMatcher) WithEndpoint(endpoint string) *ServeMatcher

WithEndpoint sets the endpoint or subdirectory where the expected content should be available. For example, WithEndpoint("/health") will attempt to access the server's /health endpoint.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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