diff options
author | Jesse Luehrs <doy@tozt.net> | 2013-02-15 16:41:06 -0600 |
---|---|---|
committer | Jesse Luehrs <doy@tozt.net> | 2013-02-15 16:41:06 -0600 |
commit | 287656ae92ba8a2fc8aaeca6fd4d1a9aba133ec5 (patch) | |
tree | 76cb863c14101d3a9887e2dd3f45da856afe8dc8 /src/test/scala/basic.scala | |
parent | 6ebf3488f2548a4412937685b7b6b5c0db95263b (diff) | |
download | scala-path-router-287656ae92ba8a2fc8aaeca6fd4d1a9aba133ec5.tar.gz scala-path-router-287656ae92ba8a2fc8aaeca6fd4d1a9aba133ec5.zip |
try out a different testing interface
Diffstat (limited to 'src/test/scala/basic.scala')
-rw-r--r-- | src/test/scala/basic.scala | 35 |
1 files changed, 18 insertions, 17 deletions
diff --git a/src/test/scala/basic.scala b/src/test/scala/basic.scala index 57a58b8..56655e4 100644 --- a/src/test/scala/basic.scala +++ b/src/test/scala/basic.scala @@ -1,8 +1,9 @@ import org.scalatest.FunSuite +import router.test._ import router.Router -class Basic extends FunSuite with RouterHelpers { +class Basic extends FunSuite { val yearRx = """\d{4}""".r val monthRx = """\d|10|11|12""".r val dayRx = """\d|[12]\d|30|31""".r @@ -55,15 +56,15 @@ class Basic extends FunSuite with RouterHelpers { ) test ("routes match properly") { - testRoute( - router, "blog", Map( + assert( + router matches "blog", Map( "controller" -> "blog", "action" -> "index" ) ) - testRoute( - router, "blog/2006/12/5", Map( + assert( + router matches "blog/2006/12/5", Map( "controller" -> "blog", "action" -> "show_date", "year" -> "2006", @@ -72,8 +73,8 @@ class Basic extends FunSuite with RouterHelpers { ) ) - testRoute( - router, "blog/1920/12/10", Map( + assert( + router matches "blog/1920/12/10", Map( "controller" -> "blog", "action" -> "show_date", "year" -> "1920", @@ -82,40 +83,40 @@ class Basic extends FunSuite with RouterHelpers { ) ) - testRoute( - router, "blog/edit/5", Map( + assert( + router matches "blog/edit/5", Map( "controller" -> "blog", "action" -> "edit", "id" -> "5" ) ) - testRoute( - router, "blog/show/123", Map( + assert( + router matches "blog/show/123", Map( "controller" -> "blog", "action" -> "show", "id" -> "123" ) ) - testRoute( - router, "blog/some_crazy_long_winded_action_name/12356789101112131151", Map( + assert( + router matches "blog/some_crazy_long_winded_action_name/12356789101112131151", Map( "controller" -> "blog", "action" -> "some_crazy_long_winded_action_name", "id" -> "12356789101112131151" ) ) - testRoute( - router, "blog/delete/5", Map( + assert( + router matches "blog/delete/5", Map( "controller" -> "blog", "action" -> "delete", "id" -> "5" ) ) - testRoute( - router, "test/x1", Map( + assert( + router matches "test/x1", Map( "controller" -> "test", "x" -> "x1", "y" -> "y" |