mocks

package
v0.4.3 Latest Latest
Warning

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

Go to latest
Published: May 8, 2023 License: MIT Imports: 9 Imported by: 0

Documentation

Overview

Package mocks provides a plugin that initializes Mocks in the test entry.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type TableEntryHooks

type TableEntryHooks struct {
	plugins.NoopAfterEntry
	// contains filtered or unexported fields
}

TableEntryHooks exposes the before and after hooks for each entry in the table.

func (*TableEntryHooks) BeforeEntry

func (h *TableEntryHooks) BeforeEntry(ctx testctx.Context, entryValue reflect.Value, i int) error

BeforeEntry is called before the test is run for the table entry. It initializes the Mocks struct and calls NEW for each of the mocks.

type TablePlugin

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

TablePlugin uses the collection of mocks, initializing and populating it for each test entry. This plugin should come before any steps that require mocks.

func New

func New(m *mocks.All) *TablePlugin

New uses the collection of mocks, initializing and populating it for each test entry.

func (*TablePlugin) ParseEntryType

func (t *TablePlugin) ParseEntryType(entryType reflect.Type) (plugins.TableEntryHooks, error)

ParseEntryType is called during the first pass of plugin initialization. It is responsible for making sure the types are as expected.

Jump to

Keyboard shortcuts

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