Migrating testcase to ScalaTest

This commit is contained in:
Naoki Takezoe
2016-02-04 00:40:58 +09:00
parent 0067cbce6f
commit 911754e1dc
2 changed files with 34 additions and 39 deletions

View File

@@ -1,26 +1,25 @@
package gitbucket.core.model
import gitbucket.core.model.CommitState._
import org.specs2.mutable.Specification
import org.scalatest.FunSpec
class CommitStateSpec extends Specification {
"CommitState" should {
"combine empty must eq PENDING" in {
combine(Set()) must_== PENDING
class CommitStateSpec extends FunSpec {
describe("CommitState") {
it("should combine empty must eq PENDING") {
assert(combine(Set()) == PENDING)
}
"combine includes ERROR must eq FAILURE" in {
combine(Set(ERROR, SUCCESS, PENDING)) must_== FAILURE
it("should combine includes ERROR must eq FAILURE") {
assert(combine(Set(ERROR, SUCCESS, PENDING)) == FAILURE)
}
"combine includes FAILURE must eq peinding" in {
combine(Set(FAILURE, SUCCESS, PENDING)) must_== FAILURE
it("should combine includes FAILURE must eq peinding") {
assert(combine(Set(FAILURE, SUCCESS, PENDING)) == FAILURE)
}
"combine includes PENDING must eq peinding" in {
combine(Set(PENDING, SUCCESS)) must_== PENDING
it("should combine includes PENDING must eq peinding") {
assert(combine(Set(PENDING, SUCCESS)) == PENDING)
}
"combine only SUCCESS must eq SUCCESS" in {
combine(Set(SUCCESS)) must_== SUCCESS
it("should combine only SUCCESS must eq SUCCESS") {
assert(combine(Set(SUCCESS)) == SUCCESS)
}
}
}