0

I'm using Scala Test Spec and JunitTestRunner in Eclipse. Where does the spec output go? And is there some way to route it to the console?

For example:

  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")))
        }
    }
 }

Only gives me the spec output from the first "describe".

jUnit results

That's about all you would want there, but I was hoping to see it all.

Jon Strayer
  • 2,058
  • 2
  • 20
  • 40

1 Answers1

2

The output comes out in the JUnit view. If I use:

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)
  }

}

And then do run as JUnit, I get the following output from the JUnit view:

enter image description here

Is this not what you want?

Matthew Farwell
  • 60,889
  • 18
  • 128
  • 171