From latest scalatest document - ScalaTest and Scalactic 3.0.1 work with scala 2.10.0+
, 2.11.0+
, and 2.12.0+
And, its working perfect to me with sbt-0.13.5
+ scala 2.11.8
installed version.
$ /usr/local/sbt-0.13.5/bin/sbt clean test
[info] Set current project to hello (in build file:/Users/prayagupd/possibilities/deleteupd/)
[success] Total time: 0 s, completed Apr 29, 2017 5:06:47 AM
[info] Updating {file:/Users/prayagupd/possibilities/programming/s2/deleteupd/}deleteupd...
[info] Resolving jline#jline;2.14.3 ...
[info] Done updating.
[info] Compiling 1 Scala source to /Users/prayagupd/possibilities/programming/deleteupd/target/scala-2.12/test-classes...
[info] 'compiler-interface' not yet compiled for Scala 2.12.2. Compiling...
[info] Compilation completed in 9.129 s
[warn] there were two deprecation warnings (since 2.12.0); re-run with -deprecation for details
[warn] one warning found
[info] ExampleSpec:
[info] A Stack
[info] - should pop values in last-in-first-out order
[info] - should throw NoSuchElementException if an empty stack is popped
[info] Run completed in 276 milliseconds.
[info] Total number of tests run: 2
[info] Suites: completed 1, aborted 0
[info] Tests: succeeded 2, failed 0, canceled 0, ignored 0, pending 0
[info] All tests passed.
[success] Total time: 12 s, completed Apr 29, 2017 5:06:59 AM
It also works with sbt 0.13.15
+ scala 2.12.2
/usr/local/sbt-0.13.15/bin/sbt clean test
[info] Loading project definition from /Users/prayagupd/possibilities/programming/deleteupd/project
[info] Set current project to whats-in-stream (in build file:/Users/prayagupd/possibilities/programming/deleteupd/)
[success] Total time: 0 s, completed Apr 30, 2017 12:01:33 PM
[info] Updating {file:/Users/prayagupd/possibilities/programming/deleteupd/}deleteupd...
[info] Resolving jline#jline;2.14.3 ...
[info] Done updating.
[info] Compiling 1 Scala source to /Users/prayagupd/possibilities/programming/deleteupd/target/scala-2.12/test-classes...
[warn] there were two deprecation warnings (since 2.12.0); re-run with -deprecation for details
[warn] one warning found
[info] ExampleSpec:
[info] A Stack
[info] - should pop values in last-in-first-out order
[info] - should throw NoSuchElementException if an empty stack is popped
[info] Run completed in 211 milliseconds.
[info] Total number of tests run: 2
[info] Suites: completed 1, aborted 0
[info] Tests: succeeded 2, failed 0, canceled 0, ignored 0, pending 0
[info] All tests passed.
[success] Total time: 5 s, completed Apr 30, 2017 12:01:37 PM
It's also working with scalatest for 2.10, installed scala version is 2.12.2
name := "whats-in-stream"
version := "1.0"
//scalaVersion := "2.12.2"
resolvers += "Artima Maven Repository" at "http://repo.artima.com/releases"
libraryDependencies += "org.scalactic" %% "scalactic" % "3.0.1"
libraryDependencies += "org.scalatest" %% "scalatest" % "3.0.1" % "test"
// running tests
$ /usr/local/sbt-0.13.15/bin/sbt clean test
[info] Loading project definition from /Users/prayagupd/possibilities/programming/deleteupd/project
[info] Set current project to whats-in-stream (in build file:/Users/prayagupd/possibilities/programming/deleteupd/)
[success] Total time: 0 s, completed Apr 30, 2017 12:06:24 PM
[info] Updating {file:/Users/prayagupd/possibilities/programming/deleteupd/}deleteupd...
[info] Resolving org.fusesource.jansi#jansi;1.4 ...
[info] downloading https://repo1.maven.org/maven2/org/scalactic/scalactic_2.10/3.0.1/scalactic_2.10-3.0.1.jar ...
[info] [SUCCESSFUL ] org.scalactic#scalactic_2.10;3.0.1!scalactic_2.10.jar(bundle) (1628ms)
[info] downloading https://repo1.maven.org/maven2/org/scalatest/scalatest_2.10/3.0.1/scalatest_2.10-3.0.1.jar ...
[info] [SUCCESSFUL ] org.scalatest#scalatest_2.10;3.0.1!scalatest_2.10.jar(bundle) (10607ms)
[info] Done updating.
[warn] Scala version was updated by one of library dependencies:
[warn] * org.scala-lang:scala-library:2.10.4 -> 2.10.6
[warn] To force scalaVersion, add the following:
[warn] ivyScala := ivyScala.value map { _.copy(overrideScalaVersion = true) }
[warn] Run 'evicted' to see detailed eviction warnings
[info] Compiling 1 Scala source to /Users/prayagupd/possibilities/programming/deleteupd/target/scala-2.10/test-classes...
[info] ExampleSpec:
[info] A Stack
[info] - should pop values in last-in-first-out order
[info] - should throw NoSuchElementException if an empty stack is popped
[info] Run completed in 193 milliseconds.
[info] Total number of tests run: 2
[info] Suites: completed 1, aborted 0
[info] Tests: succeeded 2, failed 0, canceled 0, ignored 0, pending 0
[info] All tests passed.
[success] Total time: 18 s, completed Apr 30, 2017 12:06:42 PM
Based on the error you have, its clearly a version mismatch. I recommend to cleanup dependencies and let sbt manage it again with sbt clean test
.
the scalatest cache would be at,
$ ll ~/.ivy2/cache/org.scalatest
total 0
6473425 drwxr-xr-x 9 prayagupd N\Domain Users 306 Apr 30 12:06 scalatest_2.10
5455138 drwxr-xr-x 21 prayagupd N\Domain Users 714 Jan 29 19:44 scalatest_2.11
15453522 drwxr-xr-x 6 prayagupd N\Domain Users 204 Apr 29 05:05 scalatest_2.12