CtrlK
BlogDocsLog inGet started
Tessl Logo

tessl/golang-github-com-onsi-ginkgo-v2

A mature testing framework for Go designed to help you write expressive specs

Overall
score

97%

Overview
Eval results
Files

task.mdevals/scenario-5/

Test Suite Bootstrapper

A command-line tool that helps Go developers initialize test suites for their packages using a BDD testing framework.

Capabilities

Suite Initialization

Creates test suite files for Go packages with proper boilerplate code.

  • Given a package directory path, generates a suite test file with the package name in the filename (e.g., mypackage_suite_test.go for package mypackage) @test
  • The generated suite file should contain a test function that integrates with Go's testing package @test
  • The generated suite file should set up the BDD framework runner in the test function @test
  • When the target directory already contains a suite file, returns an error indicating suite already exists @test

Custom Package Name Support

Supports both internal and external package testing patterns.

  • When given a --internal flag, generates suite file with package name matching the target package (e.g., mypackage) @test
  • When not given --internal flag, generates suite file with test package name (e.g., mypackage_test) @test

Output Formatting

Provides clear feedback during suite generation.

  • Outputs the name of the generated suite file to stdout after successful creation @test
  • When an error occurs (e.g., directory doesn't exist), outputs error message to stderr @test

Implementation

@generates

API

package main

import (
	"flag"
	"fmt"
	"os"
)

// Config holds configuration for suite bootstrapping
type Config struct {
	TargetPath string
	Internal   bool
}

// ParseFlags parses command-line flags and returns a Config
func ParseFlags() (*Config, error) {
	// Parse flags: target directory path and --internal flag
	// Returns Config or error if arguments are invalid
}

// Bootstrap creates a test suite file in the target directory
func Bootstrap(config *Config) (string, error) {
	// Creates suite file with appropriate boilerplate
	// Returns the filename created or error if suite already exists or directory invalid
}

func main() {
	// Parse flags, call Bootstrap, handle output and errors
}

Dependencies { .dependencies }

github.com/onsi/ginkgo/v2 { .dependency }

Provides BDD testing framework and suite initialization capabilities.

@satisfied-by

Install with Tessl CLI

npx tessl i tessl/golang-github-com-onsi-ginkgo-v2

tile.json