Reputation: 13372
How to run scala
specs 2
in eclipse
(scala-ide)?
My steps were:
- sbt eclipse - generate eclipse project from existing source
- eclise: import project - open project in eclipse ide
- Put break-point in my SPECS 2 test (class MyTest extends Specification { ... )
- Try to run test ...? (usually I do it in IntelliJ IDEA.. but today going to check how eclipse works with debug in
scala
..)
Upvotes: 1
Views: 2809
Reputation: 1
I had to make sure the build.sbt
file included the following information:
scalacOptions in Test ++= Seq("-Yrangepos")
"org.specs2" %% "specs2-core" % "3.6.5" % "test",
"org.specs2" %% "specs2-junit" % "3.6.5" % "test",
Upvotes: 0
Reputation: 10606
At the moment, you can use a little hack. If you annotate your Specs2 class as follows:
@RunWith(classOf[JUnitRunner])
With older versions of specs2, this should be:
@RunWith(classOf[JUnitSuiteRunner])
The Scala IDE can run it with the JUnit runner simply through the popup menu (see the details here).
I'm working on a Specs2 plug-in for the Scala IDE (well, unfortunately I haven't really found time for it for a while, but it's still on my list).
It has a working version for the previous version of the Scala IDE, it is a bit difficult to set it up but works. See the details here: http://rlegendi.github.io/specs2-runner/
Upvotes: 6