简体   繁体   中英

Don't have Run As -> Scala Test in Eclipse?

I recently re-installed my OS from scratch (Debian). Then did following:

  • Installed Scala from the repository
  • Installed Eclipse Kepler from the repository
  • Installed Scala IDE from inside Eclipse
  • created a Scala class
  • created a Scala test which makes a new instance of my class
  • copied the scalatest jar into the project and added it to the build path

Here, I noticed that I don't have "Run as -> Scala test" in the menu. Looked at the versions and noticed that I have installed a Scala IDE which is made for Scala 2.10, but I have 2.10 installed. The Eclipse version 3.8 was correct.

So I uninstalled the repository scala, downloaded 2.10.4 and installed it manually, setting both $SCALA_HOME and $PATH. I restarted the computer in case Eclipse has loaded some dependencies to the old scala, and tried running the test again. But to no avail; I have the choice to run a scala application, but not a scala test.

我的跑步配置窗口

My mini-test is extremely simple and doesn't reference anything unusual:

import org.scalatest._
import Matchers._

class StudySpec extends FlatSpec {
  "It" should "be possible to create a new Study with the default constructor." in {
    val newStudy = new Study()
  }

What did I do wrong, and how can I get the test to run?

Seems you haven't Install the ScalaTest plugin for Scala IDE . Just install it.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM