Re: How to run single Spock Test method with maven?

971 views
Skip to first unread message

Peter Niederwieser

unread,
Jan 10, 2013, 6:45:49 AM1/10/13
to spockfr...@googlegroups.com
I didn't know that Maven allows to execute single test methods. Have you tried:

mvn -Dtest="TestCircle#my test" test

Cheers,
Peter

On Jan 10, 2013, at 9:49 AM, Bill Chen <phon...@gmail.com> wrote:

It is described in maven document that it can run a specific method in a single test class with the form:

mvn -Dtest=TestCircle#mytest test

As you know, the methods in spock are define in String way like "my test ", So it doesn't work when I run like this:

mvn -Dtest=TestCircle#"my test" test

Reference: http://maven.apache.org/surefire/maven-surefire-plugin/examples/single-test.html

Any suggestions on this?
Thanks!
//Bill


--
You received this message because you are subscribed to the Google Groups "Spock Framework - User" group.
To view this discussion on the web visit https://groups.google.com/d/msg/spockframework/-/pyL_ztn0p04J.
To post to this group, send email to spockfr...@googlegroups.com.
To unsubscribe from this group, send email to spockframewor...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/spockframework?hl=en.

Luke Daley

unread,
Jan 10, 2013, 8:19:25 AM1/10/13
to spockfr...@googlegroups.com
Windows: mvn -Dtest="TestCircle#my test" test
*Nix: mvn "-Dtest=TestCircle#my test" test

Roan O'Sullivan

unread,
Apr 10, 2015, 1:41:41 PM4/10/15
to spockfr...@googlegroups.com
Neither Windows nor *Nix options listed seem to work from OS X (Java 8, Maven 3.3.1, Groovy 2.3.4). Has anybody had success with this?

Interestingly, I am able to run a single Spock test from Intellij IDEA 14.1. But seems like they don't use maven under the hood. 

Roan
Reply all
Reply to author
Forward
0 new messages