Documentation
¶
Overview ¶
Package scaffold resolves AC references, extracts Given/When/Then text, and generates scaffold scenario files for the rehearse new command.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Generate ¶
func Generate(featureSlug, acSlug string, extracted *ExtractedAC) string
Generate assembles the full scaffold markdown file content for a Rehearse scenario. It combines the feature/AC slugs and extracted Given/When/Then text into a seven-part structure: YAML frontmatter, title heading, metadata block, scenario source line, extracted text, and placeholder bash block. The returned string has no trailing newline.
Types ¶
type ExtractedAC ¶
type ExtractedAC struct {
HasGWT bool // true if Given/When/Then lines were found
Text []string // extracted lines (Given/When/Then, or fallback raw)
}
ExtractedAC holds the result of extracting Given/When/Then text from an AC body.
func Extract ¶
func Extract(acBody []string) *ExtractedAC
Extract parses acBody for Given/When/Then lines, stripping ** bold markers. An optional leading "Scenario: <name>" line is included. If no GWT lines are found the raw body is returned as-is with HasGWT false. Extraction stops at the next ### or ## heading.
type ResolveResult ¶
type ResolveResult struct {
FeatureSlug string
ACSlug string
RawBody []string // AC body lines after the ### AC: heading
}
ResolveResult holds the parsed components and raw body of a resolved AC.