使用Maven生成specs2的规范计划?
我在使用 Maven 输出 specs2 规范的规范计划时遇到问题。我有,例如,
class FooTest extends SpecificationWithJUnit{
"foo" should {
"bar" in { "bat" must_== "bat" }
}
并且想要输出,
foo should
+ bar
(...success messages...)
但我能得到的只是 JUnit 样式
Running FooTest
Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.797 sec
并且我的 Surefire 插件配置为:
<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>
是否有一个我可以设置的属性来生成所需的输出?
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 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?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以:
使用maven-scala 使用
specs2.run mypackage.MySpec
执行规范的插件(详细信息 此处)使用最新specs2快照,您可以通过当 JUnit 运行程序执行规范时,系统属性会在控制台上显示结果:
-Dspecs2.console
。在该模式下,您可以使用-Dspecs2.commandline=nocolor
传递其他命令行参数(例如,从输出中删除 ASCII 颜色)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)