Permalink
Browse files

Test scaffolding

  • Loading branch information...
1 parent fc70a4c commit 58a10287cc387dda4275ba9aeeb978fe654c5f98 @markhibberd committed Jun 15, 2011
View
@@ -1,4 +1,5 @@
gen
+*~
*.iws
out
.ensime.out
View
1 .task
@@ -1,3 +1,4 @@
+Scala 2.8.1 and 2.9 cross compile
Make java api not suck
Add content type support
Add WriterT based accumulation of attepted paths
View
@@ -62,6 +62,7 @@ compile: clean ${CLS_PROD} ${CLS_TEST} ${CLS_DEMO}
test: compile
scala -cp ${CP_TEST} org.scalatest.tools.Runner -p ${CLS_TEST} -oDFW
+ scala -cp lib/compile/\*:lib/run/\*:lib/run/scalaz/\*:lib/test/\*:gen/classes/prod:gen/classes/test specs2.run io.mth.route.AllSpecs console
${JAR}: compile ${DIST_MANIFEST} ${DIST}
jar cfm ${JAR} ${DIST_MANIFEST} -C ${CLS_PROD} .
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -0,0 +1,10 @@
+package io.mth.route
+
+import org.specs2._
+import runner.FilesRunner
+import main._
+
+class AllSpecs extends Specification with FilesRunner { def is =
+ specifications(basePath = "src/test").map(spec => spec.is).reduceLeft((a, b) => a ^ b)
+}
+
@@ -0,0 +1,15 @@
+package io.mth.route
+
+import org.specs2._
+import org.scalacheck._
+
+class ManualSpec extends Specification with ScalaCheck { def is =
+
+ "startsWith" ! check { (a: String, b: String) => (a+b).startsWith(a) } ^
+ "endsWith" ! check { (a: String, b: String) => (a+b).endsWith(b) } ^
+ "concat" ! check { (a: String, b: String) => (a+b).length > a.length && (a+b).length > b.length } ^
+ "substring" ! check { (a: String, b: String) => (a+b).substring(a.length) == b } ^
+ "substring" ! check { (a: String, b: String, c: String) => (a+b+c).substring(a.length, a.length+b.length) == b } ^
+ end
+}
+

0 comments on commit 58a1028

Please sign in to comment.