- 
                Notifications
    You must be signed in to change notification settings 
- Fork 475
10 Reasons to use Spock
Java’s dynamic companion lets you do more in less time. Plus, it’s a lot of fun!
No assertion API. No record/replay mocking API. No superfluous annotations. Everything is questioned, and only the essential is kept.
Spock’s runtime collects a wealth of information, and presents it to you when needed.
Condition not satisfied: max(a, b) == c 
                         |   |  |  |  |
                         3   1  3  |  2 
                                   false We always start from a user’s perspective, without worrying about implementation details. Everything else follows from that.
Test-first? Test-last? Unit-level? Integration-level? Test-driven? Behavior-driven? We believe there are many ways to create good software, and try to give you the flexibility to do it your way.
Express your thoughts in a beautiful and highly expressive specification language.
def "subscribers receive published events at least once"() { 
	when: 
	publisher.send(event) 
	then: 
	(1.._) * subscriber.receive(event) 
	where: 
	event << ["started", "paused", "stopped"] 
}@Transaction? @SpringBean? @DeployApp? With Spock’s interception-based extension mechanism, you can easily create your own extensions.
Run specifications with your IDE, build tool, and continuous integration server. Leverage JUnit’s reporting capabilities.