2013-07-18 93 views
1

我想與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    ${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 } 

} 

${tag("feature")}部分,使輸出一個額外的行。所以它看起來像:

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

我不想額外的線。我做錯了什麼?

回答

0

你沒有做錯任何事,這是一個報告錯誤(修復在最新的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 } 
} 
相關問題