Film opisujący co i jak http://www.youtube.com/watch?v=PAeLK6Yp2P0 Update: plugin do firefoxa
Rapid development z Liveview
Film opisujący co i jak
Update: plugin do firefoxa
import spock.lang.Specification
class OfferFacadeSpec extends Specification {
OfferFacade facade = new OfferFacade()
def setup() {
GroovyMock(Project, global: true)
}
def 'delegates an add offer call to the domain with proper params'() {
given:
Map params = [projId: projectId, name: offerName]
when:
Offer returnedOffer = facade.add(params)
then:
1 * Project.addOffer(projectId, _) >> { projId, offer -> offer }
returnedOffer.name == params.name
where:
projectId | offerName
1 | 'an Offer'
15 | 'whasup!?'
123 | 'doskonała oferta - kup teraz!'
}
}So we test a facade responsible for handling "add offer to the project" call triggered somewhere in a GUI.import spock.lang.Specification
class OfferFacadeSpec extends Specification {
OfferFacade facade = new OfferFacade()
def setup() {
GroovyMock(Project, global: true)
}
def 'delegates an add offer call to the domain with proper params'() {
given:
Map params = [projId: projectId, name: offerName]
when:
Offer returnedOffer = facade.add(params)
then:
1 * Project.addOffer(projectId, _) >> { projId, offer -> offer }
returnedOffer.name == params.name
where:
projectId | offerName
1 | 'an Offer'
15 | 'whasup!?'
123 | 'doskonała oferta - kup teraz!'
}
}So we test a facade responsible for handling "add offer to the project" call triggered somewhere in a GUI.