Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I get Scalatest into Eclipse?

I have the Typesafe stack installed, including ScalaTest for Scala IDE 0.9.3. I cannot figure out how to attach it to a new project. I have other projects (from the Coursera Scala course that I just took) that use it, but I cannot use it in a new project. Importing org.scalatest._ just tells me that "object scalatest is not a member of package org." The Coursera projects have a "Referenced Libraries" element that I don't know how to reproduce. I could copy the "lib_managed" folder into a new project, but that doesn't help.

There must be an easier way to start a new project that uses Scalatest?

like image 579
David Matuszek Avatar asked Nov 27 '12 17:11

David Matuszek


1 Answers

After experiencing the same situation, I went back and read the guide (http://www.scalatest.org/user_guide/using_scalatest_with_eclipse) carefully, as it was also not very clear to me... The ScalaTest plugin for Eclipse only prepares Eclipse for handling projects that reference the ScalaTest jar. And the ScalaTest jar (from what I have found) does not come with the ScalaTest Eclipse plugin, when you install the plugin. So, after the ScalaTest plugin instructions, when it says:

To use ScalaTest in your Scala project, you must download ScalaTest and include it in build path of your project

they really mean you must still download the ScalaTest jar separately and add it to your build path (Add External Jar). Or, even better, use SBT to add ScalaTest as a dependency. Either way, you do not have the jar just because you installed the Eclipse plugin.

like image 109
Derrick Avatar answered Oct 31 '22 17:10

Derrick