Documentation
¶
Overview ¶
Package spacefixture builds throwaway git space fixtures for tests: a bare "origin" repo (the space's remote, simulating a git host with zero network) plus one working clone per simulated system, seeded with the §4.2 tree. internal/space and internal/host tests use this instead of hand-rolling git plumbing per test file (rails pre-flight #6). P10 extends this builder for full e2e (three-system) scenarios; this phase ships the minimal version its own tests need.
Every fixture is t.TempDir-based and never touches the network — all git operations run against local paths.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Fixture ¶
type Fixture struct {
// Dir is the fixture's root temp directory.
Dir string
// OriginDir is the bare repo's path — usable directly as a git remote
// URL (git accepts local filesystem paths).
OriginDir string
// Clones maps system-id -> that system's working clone directory.
Clones map[string]string
// contains filtered or unexported fields
}
Fixture is one throwaway space: a bare origin repo plus a working clone per seeded system.
func New ¶
New creates a bare origin repo on branch "main", seeds it with a minimal space.yaml (participants = the given systems) and the §4.2 tree for each system (provides/requires/consumes.yaml/exchanges/events/docs, plus the space-level decisions/ and vendored/ directories), pushes that seed to origin, then clones origin once per system. t.Helper(); cleanup is automatic via t.TempDir().
func (*Fixture) Clone ¶
Clone returns the working clone directory for system, failing the test if system was not part of the fixture.