【发布时间】:2018-11-29 08:43:50
【问题描述】:
我有一个简单的测试设置,比如
package unit
import net.kolotyluk.leaderboard.scorekeeping._
import net.kolotyluk.leaderboard.telemetry.Metrics
import net.kolotyluk.scala.extras.Logging
import org.scalatest.{FlatSpec, GivenWhenThen, Matchers, SequentialNestedSuiteExecution}
import scala.collection.mutable.ArrayBuffer
import scala.concurrent.{Await,Future}
import scala.concurrent.duration._
import scala.concurrent.ExecutionContext.Implicits.global
import scala.util.{Failure, Random, Success}
class LeaderboardSpec
extends FlatSpec
with SequentialNestedSuiteExecution
with GivenWhenThen
with Matchers
with Logging {
behavior of "Leaderboard"
it must "handle initial conditions correctly" in {
但是当我尝试编译我的测试时,我得到了 53 个错误,例如
[IJ]sbt:leaderboard> test
[info] Compiling 1 Scala source to C:\Users\ERIC\Documents\git\repos\leaderboard\target\scala-2.12\test-classes ...
[error] C:\Users\ERIC\Documents\git\repos\leaderboard\src\test\scala\unit\LeaderboardSpec.scala:21:12: could not find implicit value for parameter pos: org.scalactic.source.Position
[error] behavior of "Leaderboard"
[error] ^
这实际上并没有传达任何有关问题所在的有用信息。我只能假设在我的 build.sbt 文件或其他地方没有正确配置某些东西。
这段代码在某个时候确实有效,但在我清理的过程中,事情发生了变化,现在它在没有良好诊断的情况下被破坏了。
任何人都可以建议要寻找的东西吗?
【问题讨论】:
-
类似的是,但问题发生在 IntelliJ 之外,来自命令行上的 sbt。现在正在审查内容...
-
stackoverflow.com/questions/41564915 中的任何内容都不适合我。