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
精彩评论