私はscalatestとscalamockを使用するようにプロジェクトをセットアップしようとしています。私はscalaバージョン2.10.0を使用しています。
ただし、依存関係を正しく取得できないようです。
私はこのコードから始めました:
class ControllerTest extends org.scalatest.FunSuite
with org.scalamock.scalatest.MockFactory {}
私はバージョンの2つの組み合わせを試しました:
1)
- org.scalatest:scalatest_2.10:1.9.1
- org.scalamock:scalamock-scalatest-support_2.10:3.0.1
これは私が得るものです:
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.
注:scalamockのドキュメントでは、アーティファクトIDは末尾の_2.10なしで指定されていますが、Mavenはこのような名前のアーティファクトを見つけることができませんでした。また、私は彼らのサイトで、scalamockでどのscalatestバージョンを使用すべきかを見つけることができませんでした。
2)
- org.scalatest:scalatest_2.10:1.9.1
- org.scalamock:scalamock-scalatest-support_2.10.0-RC5:3.0-M8
コンパイラは言う:
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 {
と
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 = ???
では、このSuiteMixinトレイトはどうなっているのでしょうか。
scalatest-support_2.10.0-RC5:3.0-M8を使用すると、scalatestlibに存在するように見えます。
scalatest-support_2.10:3.0.1を使用すると、上記のscalatestlibから削除されたようです。
これはどんな魔術ですか?そして、さらに重要なことに、それを機能させるためにどのバージョンの組み合わせを使用する必要がありますか?
ありがとう!