Using Instinct with Groovy Add comment to Wiki View in Wiki Edit Wiki page Printable Version

Instinct is a Behaviour Driven Development (BDD) framework for Java. Inspired by RSpec, Instinct provides:

  • flexible annotation of contexts, specifications, test actors, etc. (via Java 1.5 annotations, marker interfaces or naming conventions)
  • automatic creation of test doubles (dummies, mocks and stubs) and test subjects
  • state and behavioural (mocks) expectation API
  • JUnit test runner integration
  • Ant tasks

The sections below illustrate using Instinct for the examples from Using Testing Frameworks with Groovy.

The Stack Example

Here is how you might use Instinct to test the Stack Example:

which outputs:

The Item Storer Example

Here is how you might use Instinct to integration test the Item Storer Example:

We have used some BDD-flavoured method naming conventions here, but they are not compulsory. Here is the output:

 

Search

Results of your search request can come from various sources: the Groovy website itself, the JIRA issues, the API documentation, as well as a few other interesting Groovy-related blogs.

  By  -  pages  -  views  - last modified