I am having trouble starting to use ScalaTest with IntelliJ Scala Plugin.
I am using IntelliJ IDEA 13.1.1, with Scala 2.10
I have added scalatest_2.10-2.1.3 library to the Project settings
Trying to run a very simple test: the code is:
package com.xyz.scalaUtils
import org.scalatest.FlatSpec
class SpiderTest extends FlatSpec{
"A Spider" must "Return true if checkDir is invoked on an existing directory" in {
val s = new Spider("D:\\Temp","D:\\Temp\\grokTest")
assertResult(true) {
s.checkDir("D:\\Temp")
}
}
}
I created a run configuration using ScalaTest under defaults and gave the class Name SpiderTest.
But when I run, I get an error:
C:\Java64\jdk1.7.0_40\bin\java -cp D:\scala-2.11.0-M4\lib\scala-library.jar;D:\scala-2.11.0-M4\lib\scala-compiler.jar;
D:\scala-2.11.0-M4\lib\scalatest_2.10-2.1.3.jar -Didea.launcher.port=7534
"-Didea.launcher.bin.path=D:\JetBrains\IntelliJ IDEA Community Edition 13.1.1\bin"
-Dfile.encoding=UTF-8 com.intellij.rt.execution.application.AppMain
org.jetbrains.plugins.scala.testingSupport.scalaTest.ScalaTestRunner
-s com.asps.scalaUtils.SpiderTest org.scalatest.run -showProgressMessages true
-C org.jetbrains.plugins.scala.testingSupport.scalaTest.ScalaTestReporter
Testing started at 10:56 AM ...
Error: Could not find or load main class com.intellij.rt.execution.application.AppMain
Process finished with exit code 1
Why does it fail to pickup the main from ScalaTest library?
I am able to run a test successfully if I don't use ScalaTest, but place my test code under main() in the class to be tested, and configure as 'Application'
Can you help?
Thanks,
-gc