pilotando spock
Post on 16-Apr-2017
1.064 Views
Preview:
TRANSCRIPT
Pilotando con SpockRuben Eguiluz
* Project overview
* Why spock?
* Anatomy of a Spec
* Extensions
* Mocking
* Spock and Spring
* Spock and Grails
* Demo
* Q&A
* Who is using it?
* Taking off
Agenda
Hola soy Ruben Eguiluz!!
Agile Software engineer at
Java Platform lover
Fanatic of Testing
@regiluze
Project overview
Peter Niederwieser @pniederw
Current release version: 0.5 ( 2010-12-10)
Apache 2.0
Why Spock?
Easy
Powered by Groovy
Good report when fails
Good Mock framework
TDD,ATDD,BDD...
Extensible
Expressive language
Anatomy of a Spec
Spec
Fields
Methods
Spec Blocks
given
when
then
Spec Blocks
given
when
then
Spec Blocks
Exception
condition
Spec Blocks
Exception
condition
Spec Blocks
expect
where
@Unroll
Spec Blocks
expect
where
Mocking
Mocking
Mocking
Returns
Cardinalities
Mocking
Constraints
Block
Mocking
Constraints
Block
Extensions
Interception-based extension
Directives
@Timeout
@Ignore
@IgnoreRest
@FailsWith
Spock and Spring
Compatible with Spring 2.5 and 3
Relies on theTestContextAPI
Present on class path
spring-beans
spring-test
spock-spring
Spock and Grails
Versions
Grails 1.2 spock 0.5-groovy-1.6
Grails 1.3 spock 0.5-groovy-1.6
Grails 2.0 spock 0.6-SNAPSHOT
Specification extended:
UnitSpec ControllerSpec TagLibSpec IntegrationSpec GroovyPagesSpec
Demo
By @sbastn
Who is using it?
Taking off
Dependencies
>= Java 5
>= Groovy 1.6
>= Junit 4.4
Optional
CGLIB 2.1_3
Objenesis 1.1
For all tastes
Command line
Ant
Maven
Gradle
Q&A
Referenceshttp://code.google.com/p/spock/https://github.com/spockframework/spockhttp://pniederw.wordpress.com/category/spock-framework/
http://ldaley.com/post/971946675/annotation-driven-extensions-with-spockhttp://holatdd.com/http://tapestry.apache.org/http://www.gebish.org/http://gradle.org/http://griffon.codehaus.org/http://gpars.codehaus.org/http://grails.org/http://www.sky.com/http://www.betfair.com/es/http://www.donewtech.com/http://www.eharmony.com/
Gracias!
Eskerrik asko!
Thanks!
Merci!
Danke!
Grcies!
!
Grazie!
!
Obrigado!
top related