开发者

Verification tests in Scala

开发者 https://www.devze.com 2023-04-05 12:34 出处:网络
I want to make some verification in my test, but it never fails import org.testng.annotations.Test import org.specs.Specification

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

精彩评论

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

关注公众号