Spock Web Console

subscribe to the feed Subscribe
namelengths+output (via #spockwebconsole)
tweet this script Tweet

namelengths+output

Published 9 months ago by mar with tags groovy spock testing
Actions  ➤ Edit In Console Back To Console Show/Hide Line Numbers View Recent Scripts
class HelloSpock extends spock.lang.Specification {
    def "length of Spock's and his friends' names"() {
        expect:
        name.size() == length
        print "pass: " + name + " " + length + "\n"

        where:
        name     | length
        "Spock"  | 51
        "Kirk"   | 4
        "Scotty" | 6
    }
}