hammock

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

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

Go to latest
Published: Jan 17, 2023 License: MIT Imports: 4 Imported by: 0

README

damock

Mocking framework for the Go programming language.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Get

func Get[T any](r []any, n int) T

Types

type Expectation

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

func (*Expectation) Do

func (e *Expectation) Do(do func(args []any) []any)

func (*Expectation) Return

func (e *Expectation) Return(results []any)

func (*Expectation) Times

func (e *Expectation) Times(n int)

type Mock

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

func NewMock

func NewMock(t Test) *Mock

func (*Mock) Call

func (m *Mock) Call(method string, args []any) []any

func (*Mock) Expect

func (m *Mock) Expect(method string, args []any) *Expectation

type Test

type Test interface {
	Logf(msg string, args ...any)
	Fatalf(msg string, args ...any)
	Cleanup(f func())
}

Directories

Path Synopsis
cmd
internal

Jump to

Keyboard shortcuts

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