Skip to content

Instantly share code, notes, and snippets.

@matterche
Created July 16, 2015 13:03
Show Gist options
  • Save matterche/108870ad1f9c0de613df to your computer and use it in GitHub Desktop.
Save matterche/108870ad1f9c0de613df to your computer and use it in GitHub Desktop.
Template for ScalaTest table based property tests
import org.scalatest.prop.PropertyChecks._
import org.scalatest.prop.Tables.Table
import org.scalatest.WordSpec
class MyTableBasedPropertySpec extends WordSpec {
val testData = Table(
("p1", "p2", "p3"),
("1", 2, 3.0),
("4",5,6.0)
)
"A thing" when {
"something happens" should {
forAll(testData) { (p1, p2, p3) =>
s"work as expected with $p1, $p2, $p3 " in {
pending
}
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment