Domain Expectations

  • Tags : testing
  • Latest : 0.6.1
  • Last Updated: 08 May 2011
  • Grails version : 1.1
  • Authors : null
1 vote
Dependency :
compile ":domain-expectations:0.6.1"

Documentation Source

Summary

A test framework that allows you to test your domain/command constraints by defining expectations within a unit test or integration test.

Installation

grails install-plugin domain-expectations

Description

About

The Grails Domain Expectations Plugin is a Grails plugin which was written to help make developers' lives easier when writing domain constraints in a Test Driven Development (TDD) fashion.

When writing a test using the Grails Domain Expectations Plugin, a developer expresses their intent by stating an expectation. An expectation is comprised of the name of the property to be affected, the constraint to be applied, and the parameter value(s) which are necessary for the constraint to work.

Goals

The primary goals of this plugin are:

  • Ensure continuity between your domain specification and domain class implementation (unit)
  • Ensure continuity between your domain specification and domain entity implementation (integration)
If you always generate your data model from your domain classes then the first goal will be sufficient. However, if you can't generate your data model from source because you are either working with a legacy database or you are supporting a production Grails application, then the second goal becomes really important.

Documentation

Official Documentation and examples can be found here:

https://www.lone-cyprus.com/main/Grails_Domain_Expectations_Plugin