2010-12-08 48 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