开发者

Verification tests in Scala

I want to make some verification in my test, but it never fails

import org.testng.annotations.Test
import org.specs.Specification
import org.specs.mock.Mockito
import org.mockito.Matchers._

class Tests extends Specification with Mockito{
  class Foo {
    def bar(){}
  }
  @Test def simplestTest() {
    val t = mock[Foo]
    t.bar()
    there was one(t).bar()   //pass
  }
  @Test def simplestFailTest() {
    val t = mock[Foo]
    there was one(t).bar()  //pass
  }
  @Test def testFail() {
    assert(fa开发者_高级运维lse)           //fails
  }
}

I'm run it as TestNG tests. Where I'm wrong?


It doesn't seem that specs supports running tests with TestNG: http://code.google.com/p/specs/wiki/RunningSpecs

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜