浙江省高等学校教师教育理论培训

微信搜索“毛凌志岗前心得”小程序

  博客园  :: 首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理

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!

posted on 2012-07-12 13:12  lexus  阅读(154)  评论(0)    收藏  举报