• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

spock: Spock 是适合 Java 和 Groovy 应用程序的一个测试框架

原作者: [db:作者] 来自: 网络 收藏 邀请

LicenseMaven CentralGitHub Workflow Status (branch)JitpackCodecovGitterRevved up by Gradle Enterprise

Spock Framework

Spock is a BDD-style developer testing and specification framework for Java and Groovy applications.To learn more about Spock, visit https://spockframework.org. To run a sample spec in your browser, go tohttps://meetspock.appspot.com/.

Latest Versions

  • The latest 2.x release version is 2.1-M2 (2.1-M2-groovy-2.5, 2.1-M2-groovy-3.0), released on 2021-11-12.
  • The current development version is 2.1-SNAPSHOT (2.1-groovy-2.5-SNAPSHOT, 2.1-groovy-3.0-SNAPSHOT).

NOTE: Spock 2.0 is based on the JUnit 5 Platform and require Java 8+/groovy-2.5+ (Groovy 3.0 is recommended, especially in projects using Java 12+).

Releases are available from Maven Central.Development snapshots are available from Sonatype OSS.

Ad-Hoc Intermediate Releases

For intermediate stable builds we recommend to use Jitpack (go here for instructions):

  1. Add https://jitpack.io as a repository
  2. Use org.spockframework.spock as groupId and the normal artifact-id
repositories {    // ...    maven { url 'https://jitpack.io' }}dependencies {    testImplementation 'org.spockframework.spock:spock-core:spock-2.1-M2'    testImplementation 'org.spockframework.spock:spock-spring:spock-2.1-M2'}
  1. For intermediate releases you can also use the commit-hash as version, e.g. compile com.github.spockframework.spock:spock-core:d91bf785a1

Modules

  • spock-core -- Core framework. This is the only mandatory module.
  • spock-specs -- Specifications for spock-core, implemented using Spock. Not required for using Spock.
  • spock-spring -- Integration with the Spring TestContext Framework.
  • spock-tapestry -- Integration with the Tapestry 5 IoC container.
  • spock-guice -- Integration with Guice 2/3.
  • spock-unitils -- Integration with Unitils.

Building

Supported versions

Spock is supported for Java version 8+.

Spock is supported for Groovy versions 2.5 and 3.0.

The tests are testing Spock with the specific versions (variants) of Groovy and Java. Default Groovy version is 2.5.

The Groovy 2.5 and 3.0 variant should pass on all supported JDK versions:

./gradlew clean build

(Windows: gradlew clean build).All build dependencies, includingthe build tool itself, will be downloaded automatically (unless already present).

Contributing

Contributions are welcome! Please see the contributing page for detailed instructions.

Support

If you have any comments or questions, please direct them to the user forum.All feedback is appreciated!

Java 9 Module Names

All published jars (beginning with Spock 1.2) will contain Automatic-Module-Name manifest attribute. This allows for Spock to beused in a Java 9 Module Path.

  • spock-core -- org.spockframework.core
  • spock-spring -- org.spockframework.spring
  • spock-tapestry -- org.spockframework.tapestry
  • spock-guice -- org.spockframework.guice
  • spock-unitils -- org.spockframework.unitils

So module authors can use well known module names for the spock modules, e.g. something like this:

open module foo.bar {  requires org.spockframework.core;  requires org.spockframework.spring;}

Links


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
热门推荐
热门话题
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap