Skip to content

๐Ÿ“š Learning and exploring the Spock testing framework

Notifications You must be signed in to change notification settings

dgroomes/spock-playground

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

2 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

spock-playground

๐Ÿ“š Learning and exploring the Spock testing framework.

Spock is a testing and specification framework for Java and Groovy applications.

-- https://spockframework.org/spock/docs/2.3/all_in_one.html

Overview

I generally prefer writing my Java-project tests in Java and using JUnit 5 and AssertJ. But, Spock- and Groovy-based tests are pervasive and quite expressive and powerful in their own right. This repository is me learning Spock by example. I'm hoping to explore tricky bits like dynamic proxies and how to configure all the dependencies correctly (ByteBuddy?).

Standalone subprojects

This repository illustrates different concepts, patterns and examples via standalone subprojects. Each subproject is completely independent of the others and do not depend on the root project. This standalone subproject constraint forces the subprojects to be complete and maximizes the reader's chances of successfully running, understanding, and re-using the code.

The subprojects include:

basic/

This is a "Hello World"-style Spock test suite.

See the README in basic/.

mocking/

A runnable example of mocking in Spock.

See the README in mocking/.

Wish List

General clean-ups, TODOs and things I wish to implement for this project:

  • DONE Implement a basic Spock test suite showcasing assertions, maybe unrolling, and basic mocking.
  • DONE Show a mocking-focused test suite showing more circuitous mocking and stubbing, which requires a byte code rewriting tool like ByteBuddy.

About

๐Ÿ“š Learning and exploring the Spock testing framework

Topics

Resources

Stars

Watchers

Forks