我有这个代码100%来自sbt,执行sbt test但在Intellij Idea中抛出一个编译错误.
import org.scalatest.{BeforeAndAfter, FunSuite, GivenWhenThen}
class SimpleTest extends FunSuite with GivenWhenThen with BeforeAndAfter {
test("Simple Test") {
Given("Why this error?")
assert("ok" === "ok")
}
}
Run Code Online (Sandbox Code Playgroud)
错误是:
Error:(5, 10) could not find implicit value for parameter pos: org.scalactic.source.Position
Given("Why this error?")
Error:(5, 10) not enough arguments for method Given: (implicit pos: org.scalactic.source.Position)Unit.
Unspecified value parameter pos.
Given("Why this error?")
Error:(6, 11) could not find implicit value for parameter prettifier: org.scalactic.Prettifier
assert("ok" === "ok")
Error:(6, 11) …Run Code Online (Sandbox Code Playgroud)