2011-11-29 84 views
0

我在Eclipse中使用Scala Test Spec和JunitTestRunner。規格輸出在哪裏?有沒有辦法將它路由到控制檯?Eclipse中的Scalatest Spec輸出

例如:

val p = new SQLParser 
    describe("given a sql string with an order clause") { 
    describe("(when direction is asc)") { 
     val sql = "select name from users order by name asc" 
     it("should be parsed into an Asc object containing the given field") { 
      val query = p.parse(sql).get 
      query.operation should be (Select("name")) 
      query.from should be (From("users")) 
      query.order should be (Option(Asc("name"))) 
     } 
    } 
} 

只給我從最初的 「描述」 輸出規範。

jUnit results

這是對所有你想在那裏,但我希望看到這一切。

回答

2

輸出在JUnit視圖中顯示。如果我使用:

import org.scalatest.Spec 
import org.junit.runner.RunWith 
import org.scalatest.junit.JUnitRunner 

@RunWith(classOf[JUnitRunner]) 
class ExampleSpec extends Spec { 

    describe("A Stack") { 

    it("should pop values in last-in-first-out order")(pending) 

    it("should throw NoSuchElementException if an empty stack is popped")(pending) 
    } 

} 

,然後做運行JUnit的,我從JUnit視圖輸出如下:

enter image description here

這是不是你想要的?