Generate specification plan of specs2 using Maven?
I am having trouble outputting the specification plan of my specs2 specifications using Maven. I have, e.g.,
class FooTest extends SpecificationWithJUnit{
"foo" should {
"bar" in { "bat" must_== "bat" }
}
And want to have output of,
foo should
+ bar
(...success messages...)
But all I can get is the JUnit-style
Running FooTest
Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.797 sec
And my surefire plugin is 开发者_JAVA技巧configured as:
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.7.2</version>
<configuration>
<useFile>true</useFile>
<disableXmlReport>true</disableXmlReport>
<includes>
<include>**/*Test.*</include>
<include>**/*Suite.*</include>
</includes>
</configuration>
</plugin>
Is there a property I can set that will generate the desired output?
You can either:
use the maven-scala plugin to execute the specification with
specs2.run mypackage.MySpec
(details here)use the latest specs2 snapshot, where you can pass system properties to display the results on the console as the JUnit runner executes the specification:
-Dspecs2.console
. In that mode you can pass additional command line arguments with-Dspecs2.commandline=nocolor
(to remove ASCII colors from the output for example)
精彩评论