Documentation
¶
Overview ¶
Package testutil provides shared test helpers: fake implementations of internal/repo.Finder and internal/runner.Runner interfaces.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type FakeFinder ¶
FakeFinder is a test double for repo.Finder that returns a pre-configured list of paths.
type FakeRunner ¶
type FakeRunner struct {
Calls []RunCall
Output string
Err error
// contains filtered or unexported fields
}
FakeRunner is a test double for runner.Runner. It records every call and writes Output to stdout; returns Err on each call.
type SubcommandHandler ¶
SubcommandHandler is invoked by SubcommandRunner when a matching subcommand is executed.
type SubcommandRunner ¶
type SubcommandRunner struct {
// contains filtered or unexported fields
}
SubcommandRunner is a mock runner that dispatches to handlers based on command[1].
func NewSubcommandRunner ¶
func NewSubcommandRunner() *SubcommandRunner
NewSubcommandRunner creates a new SubcommandRunner.
func (*SubcommandRunner) Calls ¶
func (r *SubcommandRunner) Calls() [][]string
Calls returns a copy of all recorded calls.
func (*SubcommandRunner) On ¶
func (r *SubcommandRunner) On(subcmd string, h SubcommandHandler)
On registers a handler for a given git subcommand (e.g. "rev-parse", "symbolic-ref").