utils

package
v0.0.0-...-69b3a69 Latest Latest
Warning

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

Go to latest
Published: Nov 18, 2024 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var CodeGen = codeGen{
	Comment: codeComment{},
}
View Source
var FS = fileSystem{}
View Source
var String = stringFunctions{}

Functions

func InvokeErrorOnlyMock

func InvokeErrorOnlyMock(t *testing.T, mock mockItem, args []interface{}) error

func InvokeMock

func InvokeMock(t *testing.T, mock mockItem, args []interface{}) interface{}

func NewMockFS

func NewMockFS(t *testing.T) mockFileSystem

Types

type CodeBlock

type CodeBlock []string

A CodeBlock contains lines of generated code.

func (CodeBlock) Display

func (c CodeBlock) Display() string

func (CodeBlock) DisplayIndent

func (c CodeBlock) DisplayIndent(spaces int) string

type FileSystem

type FileSystem interface {
	NewDirectory(name string) error
	NewFile(name, contents string) error
}

type Mock

type Mock struct {
	Items map[string][]mockItem
}

func NewMock

func NewMock() Mock

func (*Mock) AddMockItem

func (m *Mock) AddMockItem(name string, args []interface{}, returnValue interface{})

func (*Mock) GetFirstMockItem

func (m *Mock) GetFirstMockItem(t *testing.T, name string) mockItem

Jump to

Keyboard shortcuts

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