我想在我的测试中进行一些验证,但它永远不会失败
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(false) //fails
}
}
我将其作为TestNG测试运行。我哪里错了?