mocks

package
v1.6.0 Latest Latest
Warning

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

Go to latest
Published: Apr 10, 2026 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BenchmarkPhaseProviderMock

type BenchmarkPhaseProviderMock struct {
	// GetBenchmarkPhaseFunc mocks the GetBenchmarkPhase method.
	GetBenchmarkPhaseFunc func(buildTool string, metadata common.CacheConfigMetadata) (string, error)
	// contains filtered or unexported fields
}

BenchmarkPhaseProviderMock is a mock implementation of common.BenchmarkPhaseProvider.

func TestSomethingThatUsesBenchmarkPhaseProvider(t *testing.T) {

	// make and configure a mocked common.BenchmarkPhaseProvider
	mockedBenchmarkPhaseProvider := &BenchmarkPhaseProviderMock{
		GetBenchmarkPhaseFunc: func(buildTool string, metadata common.CacheConfigMetadata) (string, error) {
			panic("mock out the GetBenchmarkPhase method")
		},
	}

	// use mockedBenchmarkPhaseProvider in code that requires common.BenchmarkPhaseProvider
	// and then make assertions.

}

func (*BenchmarkPhaseProviderMock) GetBenchmarkPhase

func (mock *BenchmarkPhaseProviderMock) GetBenchmarkPhase(buildTool string, metadata common.CacheConfigMetadata) (string, error)

GetBenchmarkPhase calls GetBenchmarkPhaseFunc.

func (*BenchmarkPhaseProviderMock) GetBenchmarkPhaseCalls

func (mock *BenchmarkPhaseProviderMock) GetBenchmarkPhaseCalls() []struct {
	BuildTool string
	Metadata  common.CacheConfigMetadata
}

GetBenchmarkPhaseCalls gets all the calls that were made to GetBenchmarkPhase. Check the length with:

len(mockedBenchmarkPhaseProvider.GetBenchmarkPhaseCalls())

Jump to

Keyboard shortcuts

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