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).
main
Alexander Kriegisch 7 years ago committed by Leonard Brünings
parent fb70660652
commit 043ef1319e

@ -35,16 +35,18 @@ import spock.lang.Specification
* Whereas methods can only be filtered based on annotations, classes can * Whereas methods can only be filtered based on annotations, classes can
* also be filtered based on their base class. * also be filtered based on their base class.
* *
* <p>If you directly want to see the effect of different Spock configurations,
* just run this spec from your IDE with an additional VM parameter
* <li>
* <ul><tt>-Dspock.configuration=IncludeFastConfig.groovy</tt> or</ul>
* <ul><tt>-Dspock.configuration=ExcludeSlowConfig.groovy</tt></ul>
* </li>
*
* <p>See also the two corresponding resource files provided with this spec.
*
* @since 0.4 * @since 0.4
*/ */
class IncludeExcludeExtensionSpec extends Specification { class IncludeExcludeExtensionSpec extends Specification {
static {
System.setProperty "spock.configuration", "IncludeFastConfig.groovy"
// Alternatively, try this:
// System.setProperty "spock.configuration", "ExcludeSlowConfig.groovy"
}
@Fast @Fast
def "a fast method"() { def "a fast method"() {
expect: true expect: true

Loading…
Cancel
Save