spock - the enterprise ready specification framework - Google Project Hosting

spock - the enterprise ready specification framework - Google Project Hosting

Spock is a testing and specification framework for Java and Groovy applications. What makes it stand out from the crowd is its beautiful and highly expressive specification language. Thanks to its JUnit runner, Spock is compatible with most IDEs, build tools, and continuous integration servers. Spock is inspired from JUnit, jMock, RSpec, Groovy, Scala, Vulcans, and other fascinating life forms.

class HelloSpock extends spock.lang.Specification {
   
def "length of Spock's and his friends' names"() {
        expect
:
        name
.size() == length

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

Run this example in Spock Web Console

Read ten reasons why Spock is for you, see more examples, learn how to write a specification, or get started right away!

你可能感兴趣的:(framework)