Created
June 27, 2011 06:18
-
-
Save mzp/1048386 to your computer and use it in GitHub Desktop.
unfiltered-scalatest.diff
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/scalatest/src/main/scala/jetty/Served.scala b/scalatest/src/main/scala/jetty/Served.scala | |
index 551f5e5..a54ad7c 100755 | |
--- a/scalatest/src/main/scala/jetty/Served.scala | |
+++ b/scalatest/src/main/scala/jetty/Served.scala | |
@@ -1,21 +1,21 @@ | |
package unfiltered.scalatest.jetty | |
import _root_.unfiltered.scalatest.Hosted | |
-import org.scalatest.FeatureSpec | |
+import org.scalatest.{FeatureSpec, BeforeAndAfterAll} | |
-trait Served extends FeatureSpec with Hosted { | |
+trait Served extends FeatureSpec with BeforeAndAfterAll with Hosted { | |
import unfiltered.jetty._ | |
def setup: (Server => Server) | |
- lazy val server = setup(Http(port)) | |
- override protected def withFixture(test: NoArgTest) { | |
- server.start(); | |
- try { | |
- test() // Invoke the test function | |
- } finally { | |
- server.stop(); | |
- server.destroy(); | |
- } | |
+ lazy val server : Server = setup(Http(port)) | |
+ | |
+ override protected def beforeAll { | |
+ server.start() | |
+ } | |
+ | |
+ override protected def afterAll { | |
+ server.stop() | |
+ server.destroy() | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment