Skip to content
Labs for learning about Spock Framework
Groovy Shell CSS Gosu Other
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.
todo-dropwizard-spock
todo-grails-spock
.gitignore
LICENSE
README.md

README.md

Spock Framework Labs

These labs were put together for the purpose of helping people learn more about the Spock Framework. There are two labs that users can build upon. One based on the Grails framework and the other based on Dropwizard. Both of the labs are built using the Groovy programming language. To get started, clone this Github repository, choose the lab that you would like to build upon, and get started at the appropriate section below.

Grails Todo Application Lab

To get started with the Grails Todo Application Lab, import the todo-grails-spock folder into your favorite IDE as a Grails project.

To run the Spock specifications, just run the normal Grails command from your IDE run menus. From a terminal you can also execute the specifications using the Grails wrapper from the todo-grails-spock directory like so:

./grailsw test-app

To add new Spock specifications, add a new Groovy class in the test/unit directory under an appropriate package name and make sure that the class extends spock.lang.Specification. Then take a look at the other tests to see how you can define your own scenarios.

To run the Grails server and connect to the REST endpoints, you can run the Grails application as usual with:

./grailsw run-app

Dropwizard Todo Application Lab

To get started with the Dropwizard Todo Application Lab, import todo-dropwizard-spock into your favorite IDE as a Gradle project:

To run the Spock specification, just run the normal Gradle command for 'build' from your IDE run menus. From a terminal you may also execute the specifications using the Gradle wrapper from the todo-dropwizard-spock directory like so:

./gradlew build

To run the Dropwizard server and connect to the REST endpoints, you can use the 'run' target using Gradle like so:

./gradlew run
Something went wrong with that request. Please try again.