2010-12-08 49 views
3

当我运行与IDEA规格+ Scalacheck测试中,我得到好的漂亮的输出:如何使用maven从specs + scalacheck获得漂亮的输出结果?

Specification "CoreSpec" 
    The core grammar should 
    + parse any encoded string 
    + fail to parse an empty encoded string 
    + parse an expected empty string 
    + fail on a non-empty string when expecting an empty string 
    + parse well-formed coordinates 

为了得到我的测试,使用Maven跑,我通常:

class CoreSpecTest extends JUnit4(CoreSpec) 

.. 。但然后输出不是很满意:

Running CoreSpecTest 
Tests run: 5, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.782 sec 

Results : 

Tests run: 5, Failures: 0, Errors: 0, Skipped: 0 

有没有办法在这种情况下得到漂亮的输出?

谢谢...

回答

1

我有一些解决办法为我的项目:

F.E.我有规格

类SomeSpec延伸,纺织HtmlSpecification { .... }

类Some2Spec扩展HtmlSpecification与纺织{ .... }

还我有这样的JUnit测试

@Test 类AppTest {

@Test 
def testOk = {} 

@Test 
def printSpecs { 
    (new SomeSpec).reportSpecs 
    (new Some2Spec).reportSpecs 
} 

}

我知道这不是很好的解决方案,所以 我认为最好是从maven迁移到sbt。

+0

好主意,谢谢。现在用Maven卡住... – 2010-12-08 16:36:45