grails-tdd

Guide Grails feature implementation through test-driven development with Spock.

3|Updated Apr 5, 2023
One-click install
npx skills add https://github.com/mrp4sten/.dotfiles --skill grails-tdd
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: grails-tdd
Source: https://github.com/mrp4sten/.dotfiles/tree/main/development/IA/opencode/skill/grails-tdd
Command: npx skills add https://github.com/mrp4sten/.dotfiles --skill grails-tdd

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Grails projects often suffer from regressions and unclear design. TDD enforces tests before code, ensuring early validation and documentation of intended behavior.

Core Features & Use Cases

  • Test-driven design cycles: RED-GREEN-REFACTOR to drive implementation.
  • Supports Unit, Integration, and Controller tests in Grails with Spock.
  • Step-by-step example guiding development from domain models to controllers and integration.

Quick Start

Begin by writing a failing domain test, then implement code to pass, and refactor.

Frequently Asked Questions about grails-tdd

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I implement Grails features using test-driven development with Spock?

To implement Grails features with TDD, write a failing Spock test first, then write the minimum code to pass it, and finally refactor. This Red-Green-Refactor cycle drives design from domain models to controllers.

What types of tests does TDD in Grails support?

TDD in Grails supports unit tests, integration tests, and controller tests using the Spock framework. These tests guide progression from domain models to controllers during feature development and refactoring.

Why should I use test-driven development for Grails applications?

Using TDD for Grails applications prevents regressions and clarifies software design. Writing tests before code ensures early validation and documents the intended behavior of your domain models and controllers.

Can I apply TDD to bug fixing and refactoring in Grails, or only new features?

You can apply TDD to bug fixing and refactoring in Grails, not just new feature development. Writing Spock tests first helps safely validate behavior changes and prevent future regressions during code updates.

What is the best way to start a test-driven cycle for a Grails domain model?

The best way to start is by writing a failing domain test using Spock. Once the test fails, implement the necessary Grails domain code to pass the test, then refactor the implementation for clarity.

Does Grails TDD require specific testing frameworks besides Spock?

Grails TDD relies on Spock for unit, integration, and controller tests. The metadata does not indicate additional testing frameworks are required to drive the Red-Green-Refactor cycle across Grails features.