java.lang.IllegalStateException:缺少前面方法调用的行为定义

时间:2017-06-02 11:53:47

标签: scala scalatest easymock

我使用Scala 2.11.x与Scalatest和EasyMock(也使用EasyMockSugar)有以下测试代码:

gunicorn.sh

但是,在运行时我得到以下异常:

COPY . /srv/

1 个答案:

答案 0 :(得分:1)

您需要在模拟上调用replay

class MyTestSuite extends FunSuite with Matchers with EasyMockSugar {
  test("First differential correctness") {
    val grid: Grid = mock[Grid]
    val steps = 4
    expect(grid.steps).andReturn(steps)

    replay(grid)
    // use the grid mock ...
    verify(grid)
  }
}