The Silly Weasel Roo Addons Project

The Roo Spock Testing add-on

Welcome to the Spock testing add-on project.

Currently we are generating an error on the exit of the Roo shell, so I suggest you install the add-on, set up Spock in your project, then remove the add-on.

How to use

Here is a sample test that involves the Spock Spring subproject:

package com.wedding.domain

import org.springframework.test.context.ContextConfiguration
import org.springframework.transaction.annotation.Transactional

@ContextConfiguration(locations = "classpath*:META-INF/spring/applicationContext*.xml")
class RsvpGroovyTest extends spock.lang.Specification {



    @Transactional
    def "create rsvp"() {

        setup:
        Rsvp rsvp = new Rsvp()
        rsvp.setAttending(10)
        rsvp.setCode("oj")
        rsvp.setConfirmed(new java.util.Date())
        rsvp.setEmail("test@subject.com")
        rsvp.setSpecialRequests("Vegan diet")

        when:
        rsvp.persist()
        rsvp.flush()

        then:
        rsvp.id != null

    }
}

Project Information

ItemDescriptionURL
Git Source RepoRead-only cloneable URLgit://git.cloudbees.com/sillyweasel/spock-roo-addon.git
Maven RepoFor use by OBRhttp://repository-sillyweasel.forge.cloudbees.com/release
Jenkins CIBuild statushttps://sillyweasel.ci.cloudbees.com/job/spock-roo-addon%20builder/