diff options
author | Jesse Luehrs <doy@tozt.net> | 2013-02-15 14:06:25 -0600 |
---|---|---|
committer | Jesse Luehrs <doy@tozt.net> | 2013-02-15 14:06:25 -0600 |
commit | c09960f91affd923ad1b7e26d6aaa55dc5a2dbe5 (patch) | |
tree | 9a3cb406733c9158c6b39ee8ebc7aa666f9132e4 /src/test/scala/helpers.scala | |
parent | 72d5be1bb1a25d0750fbb011cfb6cc31caa731f9 (diff) | |
download | scala-path-router-c09960f91affd923ad1b7e26d6aaa55dc5a2dbe5.tar.gz scala-path-router-c09960f91affd923ad1b7e26d6aaa55dc5a2dbe5.zip |
move shared test helpers to a separate file
Diffstat (limited to 'src/test/scala/helpers.scala')
-rw-r--r-- | src/test/scala/helpers.scala | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/test/scala/helpers.scala b/src/test/scala/helpers.scala new file mode 100644 index 0000000..f4d7ceb --- /dev/null +++ b/src/test/scala/helpers.scala @@ -0,0 +1,15 @@ +import org.scalatest.FunSuite + +import router.Router + +trait RouterHelpers { this: FunSuite => + def testRoute (router: Router[Boolean], path: String, mapping: Map[String, String]) { + assert(path === router.uriFor(mapping).get) + val om = router.route(path) + assert(om.isDefined) + val m = om.get + assert(m.mapping.size == mapping.size) + assert(m.mapping.forall { case (k, v) => mapping(k) == v }) + assert(m.target === true) + } +} |