相关疑难解决方法(0)

为什么sbt会说"糟糕的符号引用..."用于ScalaTest的测试?

我开始在sbt上使用ScalaTest.该build.sbt如下:

name := "MySpecSample"

version := "1.0"

libraryDependencies  += "org.scalatest" % "scalatest_2.11" % "2.2.0" % "test"

scalaVersion := "2.10.3" 
Run Code Online (Sandbox Code Playgroud)

初始测试代码在这里.此测试代码单独运行,没有主要组件代码.

import collection.mutable.Stack
import org.scalatest._

class ExampleSpec extends FlatSpec with Matchers {

  "A Stack" should "pop values in last-in-first-out order" in {
    val stack = new Stack[Int]
    stack.push(1)
    stack.push(2)
    stack.pop() should be (2)
    stack.pop() should be (1)
  }

  it should "throw NoSuchElementException if an empty stack is popped" in {
    val emptyStack = new Stack[Int]
    a [NoSuchElementException] should be …
Run Code Online (Sandbox Code Playgroud)

scala sbt scalatest

7
推荐指数
1
解决办法
4778
查看次数

标签 统计

sbt ×1

scala ×1

scalatest ×1