diff --git a/.mvn/wrapper/maven-wrapper.properties b/.mvn/wrapper/maven-wrapper.properties
index a3f9f18..be4fea7 100644
--- a/.mvn/wrapper/maven-wrapper.properties
+++ b/.mvn/wrapper/maven-wrapper.properties
@@ -1 +1 @@
-distributionUrl=https://repo1.maven.org/maven2/org/apache/maven/apache-maven/3.6.0/apache-maven-3.6.0-bin.zip
+distributionUrl=https://repo1.maven.org/maven2/org/apache/maven/apache-maven/3.6.3/apache-maven-3.6.3-bin.zip
diff --git a/README.md b/README.adoc
similarity index 55%
rename from README.md
rename to README.adoc
index 8dc46ec..ae927c8 100644
--- a/README.md
+++ b/README.adoc
@@ -1,58 +1,50 @@
-[](https://github.com/spockframework/spock/blob/master/LICENSE)
-[](https://travis-ci.org/spockframework/spock-example)
-[](https://gitter.im/spockframework/spock?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge)
+[.float-group]
+--
+image::https://img.shields.io/badge/License-Apache%202.0-blue.svg[link=https://github.com/spockframework/spock/blob/master/LICENSE,float=left]
+image::https://img.shields.io/travis/spockframework/spock-example/master.svg?label=Build[link=https://travis-ci.org/spockframework/spock-example,float=left]
+image::https://badges.gitter.im/spockframework/spock.svg[link=https://gitter.im/spockframework/spock?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge,float=left]
+--
+
+== Spock Framework Example Project
-Spock Framework Example Project
-===============================
The purpose of this project is to help you get started with Spock. The project includes several example specifications and build scripts for Ant, Gradle, and Maven. It also makes it easy to create an Eclipse or IDEA project, allowing you to run the example specs from within your IDE.
All three builds (Ant, Gradle, Maven) will automatically download all required dependencies, compile the project, and finally run the example specs. The Gradle build goes one step further by bootstrapping itself, alleviating the need to have a build tool preinstalled.
-Prerequisites
--------------
-- JDK 7 or higher
+=== Prerequisites
+
+- JDK 8 or higher
- Maven use `mvnw` wrapper
- Gradle use `gradlew` wrapper
-- Ant 1.7 or higher (for Ant build)
-Building with Ant
------------------
-Type:
+NOTE: This example shows the usage of Spock 2.0, which uses the JUnit Platform. If you want to see how to get Spock 1.x with JUnit 4 up and running see the https://github.com/spockframework/spock-example/tree/spock-1.x[Spock-1.x] Branch.
- ant clean test
-
-Downloaded files will be stored in the local Maven repository (typically *user_home*`/.m2/repository`).
-
-Building with Gradle
---------------------
+=== Building with Gradle
Type:
./gradlew clean test
Downloaded files (including the Gradle distribution itself) will be stored in the Gradle user home directory (typically *user_home*`/.gradle`).
-Building with Maven
--------------------
+=== Building with Maven
Type:
./mvnw clean test
Downloaded files will be stored in the local Maven repository (typically *user_home*`/.m2/repository`).
-Creating an Eclipse project
----------------------------
+=== Creating an Eclipse project
Type:
./gradlew cleanEclipse eclipse
Make sure you have a recent version of the Groovy Eclipse plugin installed. After importing the generated project into a workspace, go to Preferences->Java->Build Path->Classpath Variables and add a variable named `GRADLE_CACHE` with value *user_home*`/.gradle/cache`. (If you have an environment variable `GRADLE_USER_HOME` set, the correct value is *GRADLE_USER_HOME*`/cache`.) You should now be able to build the project, and to run the specs like you would run a JUnit test. See http://wiki.spockframework.org/GettingStarted#Eclipse for more information on how to get started with Spock and Eclipse.
-Creating an IDEA project
----------------------------
-Just open the project directory with Intelli IDEA and it should auto-detect the project settings.
+=== Creating an IDEA project
+Just open the project directory with Intelli IDEA and it should auto-detect the project settings.
-Alternativly Type:
+Alternatively Type:
./gradlew cleanIdea idea
@@ -60,34 +52,33 @@ Open the generated project in IDEA. You should now be able to build the project,
NOTE: you might also want to install https://github.com/mycila/gmavenplus-intellij-plugin so that `src/test/groovy` is correctly recognized as a test classes root.
-Getting hold of the Jars used in this project
----------------------------------------------
+=== Getting hold of the Jars used in this project
Type:
./gradlew collectJars
The Jars will be copied to `build/output/lib`. The comments in `build.gradle` explain what they are needed for.
-Further Resources
------------------
-
-* [Spock homepage](http://spockframework.org)
-* [Spock web console](https://meetspock.appspot.com)
-* [Main documentation](http://docs.spockframework.org/)
-* [User discussion group](http://forum.spockframework.org)
-* [Dev discussion group](http://dev.forum.spockframework.org)
-* [Issue tracker](http://issues.spockframework.org)
-* [Build server](http://builds.spockframework.org)
-* [Spock blog](http://blog.spockframework.org)
-* [Spock on Twitter](https://twitter.com/spockframework)
-* [Ant homepage](http://ant.apache.org)
-* [Gradle homepage](http://www.gradle.org)
-* [Groovy homepage](http://groovy-lang.org/)
-* [Maven homepage](http://maven.apache.org)
+=== Further Resources
+
+
+* http://spockframework.org[Spock homepage]
+* https://meetspock.appspot.com[Spock web console]
+* http://docs.spockframework.org/[Main documentation]
+* http://forum.spockframework.org[User discussion group]
+* http://dev.forum.spockframework.org[Dev discussion group]
+* http://issues.spockframework.org[Issue tracker]
+* http://builds.spockframework.org[Build server]
+* http://blog.spockframework.org[Spock blog]
+* https://twitter.com/spockframework[Spock on Twitter]
+* http://ant.apache.org[Ant homepage]
+* http://www.gradle.org[Gradle homepage]
+* http://groovy-lang.org/[Groovy homepage]
+* http://maven.apache.org[Maven homepage]
If you have any comments or questions, please direct them to the Spock discussion group. All feedback is appreciated!
Happy spec'ing!
-Peter Niederwieser
-Creator, Spock Framework
+
+The Spock Framework Team
diff --git a/build.gradle b/build.gradle
index 97c0860..c89eaa5 100755
--- a/build.gradle
+++ b/build.gradle
@@ -3,8 +3,8 @@ apply plugin: "groovy"
version = "1.0"
description = "Spock Framework - Example Project"
-// Spock works with Java 1.7 and above
-sourceCompatibility = 1.7
+// Spock works with Java 1.8 and above
+sourceCompatibility = 1.8
repositories {
// Spock releases are available from Maven Central
@@ -15,8 +15,10 @@ repositories {
dependencies {
// mandatory dependencies for using Spock
- compile "org.codehaus.groovy:groovy-all:2.5.7"
- testCompile "org.spockframework:spock-core:1.3-groovy-2.5"
+ compile "org.codehaus.groovy:groovy-all:2.5.8"
+ testCompile platform("org.spockframework:spock-bom:2.0-M1-groovy-2.5")
+ testCompile "org.spockframework:spock-core"
+ testCompile "org.spockframework:spock-junit4" // you can remove this if your code does not rely on old JUnit 4 rules
// optional dependencies for using Spock
testCompile "org.hamcrest:hamcrest-core:1.3" // only necessary if Hamcrest matchers are used
@@ -35,6 +37,11 @@ task collectJars(type: Copy) {
into "$buildDir/output/lib"
from configurations.testRuntime
}
-
+test {
+ useJUnitPlatform()
+ testLogging {
+ events "passed", "skipped", "failed"
+ }
+}
diff --git a/build.xml b/build.xml
deleted file mode 100644
index 230a25e..0000000
--- a/build.xml
+++ /dev/null
@@ -1,112 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties
index f4d7b2b..b90bf3e 100644
--- a/gradle/wrapper/gradle-wrapper.properties
+++ b/gradle/wrapper/gradle-wrapper.properties
@@ -1,5 +1,6 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
-distributionUrl=https\://services.gradle.org/distributions/gradle-5.4.1-bin.zip
+distributionSha256Sum=d364b7098b9f2e58579a3603dc0a12a1991353ac58ed339316e6762b21efba44
+distributionUrl=https\://services.gradle.org/distributions/gradle-6.0.1-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
diff --git a/gradlew b/gradlew
index b0d6d0a..83f2acf 100755
--- a/gradlew
+++ b/gradlew
@@ -7,7 +7,7 @@
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
-# http://www.apache.org/licenses/LICENSE-2.0
+# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
@@ -125,8 +125,8 @@ if $darwin; then
GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
fi
-# For Cygwin, switch paths to Windows format before running java
-if $cygwin ; then
+# For Cygwin or MSYS, switch paths to Windows format before running java
+if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then
APP_HOME=`cygpath --path --mixed "$APP_HOME"`
CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
JAVACMD=`cygpath --unix "$JAVACMD"`
diff --git a/gradlew.bat b/gradlew.bat
index 15e1ee3..9618d8d 100644
--- a/gradlew.bat
+++ b/gradlew.bat
@@ -1,100 +1,100 @@
-@rem
-@rem Copyright 2015 the original author or authors.
-@rem
-@rem Licensed under the Apache License, Version 2.0 (the "License");
-@rem you may not use this file except in compliance with the License.
-@rem You may obtain a copy of the License at
-@rem
-@rem http://www.apache.org/licenses/LICENSE-2.0
-@rem
-@rem Unless required by applicable law or agreed to in writing, software
-@rem distributed under the License is distributed on an "AS IS" BASIS,
-@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-@rem See the License for the specific language governing permissions and
-@rem limitations under the License.
-@rem
-
-@if "%DEBUG%" == "" @echo off
-@rem ##########################################################################
-@rem
-@rem Gradle startup script for Windows
-@rem
-@rem ##########################################################################
-
-@rem Set local scope for the variables with windows NT shell
-if "%OS%"=="Windows_NT" setlocal
-
-set DIRNAME=%~dp0
-if "%DIRNAME%" == "" set DIRNAME=.
-set APP_BASE_NAME=%~n0
-set APP_HOME=%DIRNAME%
-
-@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
-set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m"
-
-@rem Find java.exe
-if defined JAVA_HOME goto findJavaFromJavaHome
-
-set JAVA_EXE=java.exe
-%JAVA_EXE% -version >NUL 2>&1
-if "%ERRORLEVEL%" == "0" goto init
-
-echo.
-echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
-echo.
-echo Please set the JAVA_HOME variable in your environment to match the
-echo location of your Java installation.
-
-goto fail
-
-:findJavaFromJavaHome
-set JAVA_HOME=%JAVA_HOME:"=%
-set JAVA_EXE=%JAVA_HOME%/bin/java.exe
-
-if exist "%JAVA_EXE%" goto init
-
-echo.
-echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
-echo.
-echo Please set the JAVA_HOME variable in your environment to match the
-echo location of your Java installation.
-
-goto fail
-
-:init
-@rem Get command-line arguments, handling Windows variants
-
-if not "%OS%" == "Windows_NT" goto win9xME_args
-
-:win9xME_args
-@rem Slurp the command line arguments.
-set CMD_LINE_ARGS=
-set _SKIP=2
-
-:win9xME_args_slurp
-if "x%~1" == "x" goto execute
-
-set CMD_LINE_ARGS=%*
-
-:execute
-@rem Setup the command line
-
-set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
-
-@rem Execute Gradle
-"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
-
-:end
-@rem End local scope for the variables with windows NT shell
-if "%ERRORLEVEL%"=="0" goto mainEnd
-
-:fail
-rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
-rem the _cmd.exe /c_ return code!
-if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
-exit /b 1
-
-:mainEnd
-if "%OS%"=="Windows_NT" endlocal
-
-:omega
+@rem
+@rem Copyright 2015 the original author or authors.
+@rem
+@rem Licensed under the Apache License, Version 2.0 (the "License");
+@rem you may not use this file except in compliance with the License.
+@rem You may obtain a copy of the License at
+@rem
+@rem https://www.apache.org/licenses/LICENSE-2.0
+@rem
+@rem Unless required by applicable law or agreed to in writing, software
+@rem distributed under the License is distributed on an "AS IS" BASIS,
+@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+@rem See the License for the specific language governing permissions and
+@rem limitations under the License.
+@rem
+
+@if "%DEBUG%" == "" @echo off
+@rem ##########################################################################
+@rem
+@rem Gradle startup script for Windows
+@rem
+@rem ##########################################################################
+
+@rem Set local scope for the variables with windows NT shell
+if "%OS%"=="Windows_NT" setlocal
+
+set DIRNAME=%~dp0
+if "%DIRNAME%" == "" set DIRNAME=.
+set APP_BASE_NAME=%~n0
+set APP_HOME=%DIRNAME%
+
+@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
+set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m"
+
+@rem Find java.exe
+if defined JAVA_HOME goto findJavaFromJavaHome
+
+set JAVA_EXE=java.exe
+%JAVA_EXE% -version >NUL 2>&1
+if "%ERRORLEVEL%" == "0" goto init
+
+echo.
+echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
+echo.
+echo Please set the JAVA_HOME variable in your environment to match the
+echo location of your Java installation.
+
+goto fail
+
+:findJavaFromJavaHome
+set JAVA_HOME=%JAVA_HOME:"=%
+set JAVA_EXE=%JAVA_HOME%/bin/java.exe
+
+if exist "%JAVA_EXE%" goto init
+
+echo.
+echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
+echo.
+echo Please set the JAVA_HOME variable in your environment to match the
+echo location of your Java installation.
+
+goto fail
+
+:init
+@rem Get command-line arguments, handling Windows variants
+
+if not "%OS%" == "Windows_NT" goto win9xME_args
+
+:win9xME_args
+@rem Slurp the command line arguments.
+set CMD_LINE_ARGS=
+set _SKIP=2
+
+:win9xME_args_slurp
+if "x%~1" == "x" goto execute
+
+set CMD_LINE_ARGS=%*
+
+:execute
+@rem Setup the command line
+
+set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
+
+@rem Execute Gradle
+"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
+
+:end
+@rem End local scope for the variables with windows NT shell
+if "%ERRORLEVEL%"=="0" goto mainEnd
+
+:fail
+rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
+rem the _cmd.exe /c_ return code!
+if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
+exit /b 1
+
+:mainEnd
+if "%OS%"=="Windows_NT" endlocal
+
+:omega
diff --git a/pom.xml b/pom.xml
index 7248bb5..8e4aa41 100644
--- a/pom.xml
+++ b/pom.xml
@@ -35,7 +35,7 @@
maven-surefire-plugin
- 2.20.1
+ 3.0.0-M4
false
@@ -55,20 +55,35 @@
+
+
+
+ org.spockframework
+ spock-bom
+ 2.0-M1-groovy-2.5
+ pom
+ import
+
+
+
+
org.spockframework
spock-core
- 1.3-groovy-2.5
+ test
+
+
+ org.spockframework
+ spock-junit4
test
org.codehaus.groovy
- groovy-all
- 2.5.7
- pom
+ groovy
+ 2.5.8
net.bytebuddy