Scala specs2运行特定的测试

Scala specs2运行特定的测试,scala,specs2,Scala,Specs2,我试图用specs2运行一个特定的测试,但我遇到了一个小问题。这是我正在运行的代码: import org.specs2._ class DemoSpec2 extends Specification { def is = s2""" This is a specification to check the 'Hello world' string The 'Hello world' string should contain 11 characters

我试图用specs2运行一个特定的测试,但我遇到了一个小问题。这是我正在运行的代码:

import org.specs2._

class DemoSpec2 extends Specification {
  def is = s2"""

  This is a specification to check the 'Hello world' string

  The 'Hello world' string should
    contain 11 characters              ${Set11().e1}        ${tag("feature")}
    start with 'Hello'                 ${Set2().e2}         ${tag("abc")}

                                       """

  case class Set11(){ def e1 = 1 must_== 1 }
  case class Set2(){ def e2 = 1 must_== 1 }

}
${tagfeature}部分在输出中额外生成一行。所以它看起来像:

[info]   The 'Hello world' string should
[info]     + contain 11 characters
[info]         
[info]     + start with 'Hello'

我不想要额外的线路。我做错了什么?

您没有做错任何事情,这是一个在最新的2.2-SNAPSHOT中修复的报告错误。同时,如果不使用空格,则一切正常:

import org.specs2._

class DemoSpec2 extends Specification {
  def is = s2"""

  This is a specification to check the 'Hello world' string

  The 'Hello world' string should
    contain 11 characters              ${Set11().e1}${("feature")}
    start with 'Hello'                 ${Set2().e2}${tag("abc")}

                                   """
  case class Set11(){ def e1 = 1 must_== 1 }
  case class Set2(){ def e2 = 1 must_== 1 }
}