Scalar and scalamous addiction problems associated with SuiteMixin

I am trying to configure my project to use scalatest and scalamock. I am using scala version 2.10.0.
However, I do not seem to understand the dependency.

I started with this code:

class ControllerTest extends org.scalatest.FunSuite with org.scalamock.scalatest.MockFactory {} 

I tried two combinations of versions:

1)

  • org.scalatest: scalatest_2.10 : 1.9.1
  • org.scalamock: scalamock-scalatest-support_2.10 : 3.0.1

This is what I get:

 scala: bad symbolic reference. A signature in MockFactory.class refers to type SuiteMixin in package org.scalatest which is not available. It may be completely missing from the current classpath, or the version on the classpath might be incompatible with the version used when compiling MockFactory.class. 

Note: in the documentation for the scalalon , the artifact identifier is specified without the final _2.10, but maven could not find the artifact with a name like this. In addition, I could not find on my site which version of the scalal should be used with the scalal.

2)

  • org.scalatest: scalatest_2.10 : 1.9.1
  • org.scalamock: scalamock-scalatest-support_2.10.0-RC5 : 3.0-M8

The compiler says:

 scala: overriding method nestedSuites in trait SuiteMixin of type => scala.collection.immutable.IndexedSeq[org.scalatest.Suite]; method nestedSuites in trait Suite of type => List[org.scalatest.Suite] has incompatible type class ControllerTest extends FunSuite with MockFactory { 

and

 scala: class ControllerTest needs to be abstract, since: it has 5 unimplemented members. /** As seen from class ControllerTest, the missing signatures are as follows. * For convenience, these are usable as stub implementations. */ def rerunner: Option[String] = ??? def run(testName: Option[String],args: org.scalatest.Args): org.scalatest.Status = ??? protected def runNestedSuites(args: org.scalatest.Args): org.scalatest.Status = ??? protected def runTest(testName: String,args: org.scalatest.Args): org.scalatest.Status = ??? protected def runTests(testName: Option[String],args: org.scalatest.Args): org.scalatest.Status = ??? 

So what's with this sign of SuiteMixin?
If I use scalatest-support_2.10.0-RC5: 3.0-M8, it apparently exists in the scalatest lib .
If I use scalatest-support_2.10: 3.0.1, it seems to have left the mentioned libatestest lib.

What kind of witchcraft is this? And more importantly, which combination of versions should I use to make it work?

Thanks!

+4
source share
2 answers

If you have this addiction

 "org.scalamock" %% "scalamock-scalatest-support" % "3.0.1" % "test" 

It will automatically download the correct version of scalatest. In this case, it is

 org.scalatest#scalatest_2.10;2.0.M5b!scalatest_2.10.jar 

In most cases, when one library depends on another, you simply add only one library as a dependency. Sbt-like tools will get other dependencies.

+6
source

EECOLOR answer is correct. To clarify, the cause of the problem was that the version of ScalaMock you selected was compiled against a later version of ScalaTest (2.0.M5b) than the one you were explicitly trying to use (1.9.1).

+2
source

All Articles