【问题标题】:How to get pretty output from specs+scalacheck with maven?如何使用 maven 从 specs+scalacheck 中获得漂亮的输出?
【发布时间】:2011-05-22 02:41:20
【问题描述】:

当我使用 IDEA 运行 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

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

谢谢...

【问题讨论】:

    标签: scala maven specs scalacheck


    【解决方案1】:

    我的项目有一些解决方法:

    f.e.我有规格

    class SomeSpec 使用 Textile { …… }

    类 Some2Spec 使用 Textile { 扩展 HtmlSpecification …… }

    我也有这样的 Junit 测试

    @测试 类 AppTest {

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

    }

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

    【讨论】:

      猜你喜欢
      • 2014-06-05
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2021-05-06
      • 1970-01-01
      相关资源
      最近更新 更多