From 043ef1319e073b7b10d89abe6ed64dac4462f545 Mon Sep 17 00:00:00 2001 From: Alexander Kriegisch Date: Mon, 24 Sep 2018 22:11:13 +0200 Subject: [PATCH] Improve Javadoc of IncludeExcludeExtensionSpec, Remove static block (#26) Setting system property "spock.configuration" during class initialisation is too late for Spock to pick up the config, so the static block is pointless and misleads users to believe they can actually configure the system this way. Instead the Javadoc was amended by information how to set the system property via '-D' JVM command-line argument when running a test from an IDE (or from the command line, for that matter). --- .../groovy/IncludeExcludeExtensionSpec.groovy | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/src/test/groovy/IncludeExcludeExtensionSpec.groovy b/src/test/groovy/IncludeExcludeExtensionSpec.groovy index 11d66d0..70e3d2a 100644 --- a/src/test/groovy/IncludeExcludeExtensionSpec.groovy +++ b/src/test/groovy/IncludeExcludeExtensionSpec.groovy @@ -35,16 +35,18 @@ import spock.lang.Specification * Whereas methods can only be filtered based on annotations, classes can * also be filtered based on their base class. * + *

If you directly want to see the effect of different Spock configurations, + * just run this spec from your IDE with an additional VM parameter + *

  • + * + * + *
  • + * + *

    See also the two corresponding resource files provided with this spec. + * * @since 0.4 */ class IncludeExcludeExtensionSpec extends Specification { - static { - System.setProperty "spock.configuration", "IncludeFastConfig.groovy" - - // Alternatively, try this: - // System.setProperty "spock.configuration", "ExcludeSlowConfig.groovy" - } - @Fast def "a fast method"() { expect: true