testutil

package
v0.0.0-...-1783878 Latest Latest
Warning

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

Go to latest
Published: Jan 26, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package testutil provides test helpers for setup-workflow tests.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Chdir

func Chdir(t *testing.T, dir string)

Chdir changes the working directory for the duration of the test. The original directory is restored when the test completes.

func CreateClaudeDir

func CreateClaudeDir(t *testing.T, projectDir string) string

CreateClaudeDir creates the .claude directory structure for testing.

func CreateClaudeMD

func CreateClaudeMD(t *testing.T, dir, content string) string

CreateClaudeMD creates a CLAUDE.md file with the given content. If content is empty, creates a sample CLAUDE.md.

func CreateDir

func CreateDir(t *testing.T, base, name string) string

CreateDir creates a directory (including parents) in the specified base directory. Returns the full path to the created directory.

func CreateFile

func CreateFile(t *testing.T, dir, name, content string) string

CreateFile creates a file with the given content in the specified directory. Returns the full path to the created file.

func InitGitRepo

func InitGitRepo(t *testing.T, dir string) string

InitGitRepo initializes a git repository in the given directory. Returns the directory path for convenience.

func SampleAgentMD

func SampleAgentMD(name, description string) string

SampleAgentMD returns sample agent file content.

func SampleClaudeMD

func SampleClaudeMD() string

SampleClaudeMD returns a sample CLAUDE.md content for testing.

func SampleClaudeMDFlutter

func SampleClaudeMDFlutter() string

SampleClaudeMDFlutter returns a Flutter-focused CLAUDE.md for testing.

func SampleClaudeMDGo

func SampleClaudeMDGo() string

SampleClaudeMDGo returns a Go-focused CLAUDE.md for testing.

func SampleClaudeMDJava

func SampleClaudeMDJava() string

SampleClaudeMDJava returns a Java-focused CLAUDE.md for testing.

func SampleCommandMD

func SampleCommandMD(description string) string

SampleCommandMD returns sample command file content.

func SampleConfigYAML

func SampleConfigYAML() string

SampleConfigYAML returns sample config YAML for testing.

func SampleProjectStateYAML

func SampleProjectStateYAML() string

SampleProjectStateYAML returns sample project state YAML for testing.

func SampleSkillMD

func SampleSkillMD(description string) string

SampleSkillMD returns sample skill file content.

func SetGitRemote

func SetGitRemote(t *testing.T, dir, remoteURL string)

SetGitRemote sets the origin remote for a git repository.

func TempDir

func TempDir(t *testing.T) string

TempDir creates a temporary directory for testing and returns its path. The directory is automatically cleaned up when the test completes.

Types

This section is empty.

Jump to

Keyboard shortcuts

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