我想在我的测试中做一些验证,但它从来没有失败过
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测试运行。我哪里错了?
specs似乎不支持使用TestNG运行测试:http://code.google.com/p/specs/wiki/RunningSpecs