Skip to content
Browse files

Fix specs2 base trait infrastructure

  • Loading branch information...
1 parent f647cf7 commit e4cd251b5b5679a56aa7cad977a13c46a0cb3bac @casualjim casualjim committed Mar 22, 2013
View
13 specs2/src/main/scala/org/scalatra/test/specs2/BaseScalatraSpec.scala
@@ -2,13 +2,14 @@ package org.scalatra
package test
package specs2
-import org.specs2.specification.{BaseSpecification, Step, Fragments}
+import org.specs2.specification.{SpecificationStructure, BaseSpecification, Step, Fragments}
+import org.specs2.mutable.FragmentsBuilder
/**
- * A base specification structure that starts the tester before the
- * specification and stops it afterward. Clients probably want to extend
- * ScalatraSpec or MutableScalatraSpec.
- */
-trait BaseScalatraSpec extends BaseSpecification with ScalatraTests {
+* A base specification structure that starts the tester before the
+* specification and stops it afterward. Clients probably want to extend
+* ScalatraSpec or MutableScalatraSpec.
+*/
+trait BaseScalatraSpec extends SpecificationStructure with FragmentsBuilder with ScalatraTests {
override def map(fs: =>Fragments) = Step(start()) ^ super.map(fs) ^ Step(stop())
}
View
4 specs2/src/main/scala/org/scalatra/test/specs2/MutableScalatraSpec.scala
@@ -2,7 +2,7 @@ package org.scalatra
package test
package specs2
-import org.specs2.mutable.Specification
+import org.specs2.mutable.SpecificationLike
/**
* A Specification that starts the tester before the specification and stops it
@@ -11,4 +11,4 @@ import org.specs2.mutable.Specification
* This is a spec of the mutable variation of the specs2 framework.
* All documentation for specs2 still applies.
*/
-trait MutableScalatraSpec extends Specification with BaseScalatraSpec
+trait MutableScalatraSpec extends BaseScalatraSpec with SpecificationLike with ScalatraTests
View
5 specs2/src/main/scala/org/scalatra/test/specs2/ScalatraSpec.scala
@@ -2,7 +2,8 @@ package org.scalatra
package test
package specs2
-import org.specs2.Specification
+import org.specs2.SpecificationLike
+
/**
* A Specification that starts the tester before the specification and stops it
@@ -11,4 +12,4 @@ import org.specs2.Specification
* This is a spec of the immutable variation of the specs2 framework.
* All documentation for specs2 still applies.
*/
-trait ScalatraSpec extends Specification with BaseScalatraSpec
+trait ScalatraSpec extends BaseScalatraSpec with SpecificationLike with ScalatraTests
View
2 specs2/src/test/scala/org/scalatra/test/specs2/ScalatraSpecSpec.scala
@@ -12,7 +12,7 @@ class ScalatraSpecSpec extends ScalatraSpec { def is =
// simple servlet for a sanity check
addServlet(new HttpServlet {
override def doGet(req: HttpServletRequest, res: HttpServletResponse) {
- res.getWriter.write("Hello, world.");
+ res.getWriter.write("Hello, world.")
}
}, "/*")

0 comments on commit e4cd251

Please sign in to comment.
Something went wrong with that request. Please try again.