fakerunner

package
v0.22.3 Latest Latest
Warning

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

Go to latest
Published: Nov 6, 2025 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Package fakerunner provides a fake implementation of execx.Runner for testing.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Call

type Call struct {
	Name string
	Args []string
}

Call represents a captured command execution call.

type Runner

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

Runner is a fake implementation of execx.Runner for testing.

func New

func New() *Runner

New creates a new fake runner.

func (*Runner) CombinedOutput

func (r *Runner) CombinedOutput(_ context.Context, name string, args ...string) ([]byte, error)

CombinedOutput implements execx.Runner.

func (*Runner) GetCalls

func (r *Runner) GetCalls() []Call

GetCalls returns all captured command calls.

func (*Runner) Reset

func (r *Runner) Reset()

Reset clears all stored outputs, errors, and calls.

func (*Runner) SetError

func (r *Runner) SetError(name string, args []string, err error)

SetError sets the error for a specific command.

func (*Runner) SetOutput

func (r *Runner) SetOutput(name string, args []string, output []byte)

SetOutput sets the output for a specific command.

Jump to

Keyboard shortcuts

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