mocks

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Oct 18, 2024 License: Apache-2.0, MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ProjectRunnerMock

type ProjectRunnerMock struct {
	// RunTargetFunc mocks the RunTarget method.
	RunTargetFunc func(target string, opts ...earthly.EarthlyExecutorOption) error
	// contains filtered or unexported fields
}

ProjectRunnerMock is a mock implementation of run.ProjectRunner.

func TestSomethingThatUsesProjectRunner(t *testing.T) {

	// make and configure a mocked run.ProjectRunner
	mockedProjectRunner := &ProjectRunnerMock{
		RunTargetFunc: func(target string, opts ...earthly.EarthlyExecutorOption) error {
			panic("mock out the RunTarget method")
		},
	}

	// use mockedProjectRunner in code that requires run.ProjectRunner
	// and then make assertions.

}

func (*ProjectRunnerMock) RunTarget

func (mock *ProjectRunnerMock) RunTarget(target string, opts ...earthly.EarthlyExecutorOption) error

RunTarget calls RunTargetFunc.

func (*ProjectRunnerMock) RunTargetCalls

func (mock *ProjectRunnerMock) RunTargetCalls() []struct {
	Target string
	Opts   []earthly.EarthlyExecutorOption
}

RunTargetCalls gets all the calls that were made to RunTarget. Check the length with:

len(mockedProjectRunner.RunTargetCalls())

Jump to

Keyboard shortcuts

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