从某种意义上讲,easyb就是Groovy版的RSpec,是一个基于"BDD: Behavior-Driven Development"思维方式的测试框架。其作者Andrew Glover是《Groovy in Action》一书的合著者之一。项目的主页在:
http://easyb.org/不多废话了,上代码,一个story大概长成这个样子(为了方便大家理解,举一个无比弱智的例子):
<!---->scenario '1+1应该等于2', {
given 'a和b分别等于1', {
a = 1
b = 1
}
when 'c是a+b的和', {
c = a + b
}
then 'c应该等于2', {
c.shouldBe 2
}
}
如何在Eclipse环境下跑这段story脚本?请参考官方文档:
http://code.google.com/p/easyb/wiki/ConfiguringEclipseToRunEasyb最后你的输出应该类似:
<!---->Running first easyb story (FirstEasybStory.groovy)
Scenarios run: 1, Failures: 0, Pending: 0, Time Elapsed: 0.629 sec
1 behavior run with no failures
分享到:
相关推荐
maven-easyb-plugin-0.8.jar
maven-easyb-plugin-1.4-sources.jar
maven-easyb-plugin-1.3-sources.jar
maven-easyb-plugin-1.2-sources.jar
maven-easyb-plugin-1.1-sources.jar
maven-easyb-plugin-0.9.7-sources.jar
maven-easyb-plugin-0.9.7-1.jar
maven-easyb-plugin-0.9.6-sources.jar
maven-easyb-plugin-0.9.5-sources.jar
maven-easyb-plugin-0.9.2-sources.jar
maven-easyb-plugin-0.9.1-sources.jar
maven-easyb-plugin-0.8-sources.jar
maven-easyb-plugin-0.7-sources.jar
maven-easyb-plugin-0.9.jar
maven-easyb-plugin-1.4.jar
maven-easyb-plugin-1.3.jar
maven-easyb-plugin-1.2.jar
maven-easyb-plugin-1.1.jar
maven-easyb-plugin-0.9.7.jar
maven-easyb-plugin-0.9.6.jar