How to use ScalaTest library

Hi.

I was watching a tutorial about using this plugin in IDEA (http://www.youtube.com/watch?v=UJe4wPUtcUQ) and there was a mention about adding ScalaTest library to a project.
But I can't find ScalaTest library in my dependencies. I've installed latest Scala plugin for Intellij IDEA 13, and it's said on plugins page (http://www.jetbrains.com/idea/features/scala.html) that it has "built-in support for JUnit, ScalaTest".
But I can't use it! How can I add it to my dependencies? I'm a complete beginner in Scala and know nothing about Java and all that Java stuff, so I have no idea how to do it.

Please, can someone tell me, step by step, how to install/enable ScalaTest support? (I've spent hours googling the answer, but didn't find anything, even on jetbrains web site).

Thanks.

0
Avatar
Permanently deleted user

ScalaTest does not come automatically with Intellij. The best way to add ScalaTest library is done by sbt.
Ex. http://stackoverflow.com/questions/7392474/create-simple-project-sbt-0-10-x
Most probably in your build.sbt file you need to add following:

If you run Intellij 13, then you may directly import your sbt file. If not, you can run "sbt gen-idea" that creates an intellij idea project automatically, then you can open this project directly under intellij.


0
Avatar
Permanently deleted user

Thank you for your reply. This will probably help (will try it later), but in the tutorial video ScalaTest library was simply added via GUI: create project then open Project Structure dialog, select Modules, then Dependencies tab, click add Library and ScalaTest was there (screenshot from tutorial video):

one.png

and here what I have:

two.png
So, should I install ScalaTest on my machine and import it to Intellij IDEA somehow to make it available in this dialog?

0
Avatar
Permanently deleted user

I never try, you can probably do that way, which is actually not recommended. Use SBT just like Maven to Java, which helps you to manage your project structure and resolve dependencies etc.
Intellij does have built in support for ScalaTest, but that doesn't mean it is there ready to use.
I'd suggest follow the steps from:
http://www.scalatest.org/user_guide/using_scalatest_with_intellij

0
Avatar
Permanently deleted user

Thank you, Jiangong.

Finally, following your last link I found how to include ScalaTest library from Maven repository.

0

请先登录再写评论。