Skip to content

Workshop to learn about Spock Framework

License

Notifications You must be signed in to change notification settings

ticketbis/spock-workshop

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

27 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

spock-workshop

This workshop is aimed to all those who want to learn and understand the basics of Spock Framework using Groovy.

If you want to follow this workshop by your own, we strongly recommend you to check Spock basics before start coding.

How to start

You can find three different exercises in /src/test/ in the master branch:

Each of the files is a Spock test, and you will find there some comments that explain what to do.

There already is working code in /src/main/ that you should not change. It works as it is, and you should only change the Spec files, creating everything you need in order to complete all the TODO tasks.

Each TODO task should be solved using only one feature method, but feel free to do it your way.

Run the tests with Gradle

./gradlew test

Run the tests with IntelliJ IDEA

First of all, import the project in IntelliJ:

  • File > New > Project from Existing Sources...
  • Select the build.gradle file.
  • Select Use default gradle wrapper in the import process and an existing java version.

Finally, you can select a specific test file or a package and Secondary click > Run [file|Tests in package].

Solutions

You will find our solutions proposal in the Solutions branch.

We tried to solve the tasks using different approaches in order to show different Spock features.

If you don't understand something in the solved exercises, we recommend you to search for it in the Spock Framework Reference Documentation. You will find there everything we used.

About

Workshop to learn about Spock Framework

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages