Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

switch to scalatest.

  • Loading branch information...
commit 746287ce02ac22e526d2e42085a5e004173f0753 1 parent 5f61fbf
Robey Pointer authored
View
3  lib/template/build.sbt.erb
@@ -14,7 +14,8 @@ libraryDependencies ++= Seq(
"com.twitter" %% "finagle-core" % "2.0.1",
"com.twitter" %% "finagle-thrift" % "2.0.1",
"com.twitter" %% "finagle-ostrich4" % "2.0.1",
- "org.scala-tools.testing" %% "specs" % "1.6.9" % "test"
+ "org.scalatest" %% "scalatest" % "1.7.1" % "test",
+ "com.twitter" %% "scalatest-mixins" % "1.0.0" % "test"
)
mainClass in (Compile, run) := Some("com.twitter.birdname.Main")
View
2  lib/template/config/test.scala.erb
@@ -20,7 +20,7 @@ new BirdNameServiceConfig {
loggers =
new LoggerConfig {
- level = Level.INFO
+ level = Level.FATAL
handlers = new ConsoleHandlerConfig
}
}
View
7 lib/template/src/test/scala/com/twitter/birdname/AbstractSpec.scala.erb
@@ -2,11 +2,12 @@ package com.twitter.birdname
import com.twitter.conversions.time._
import com.twitter.ostrich.admin._
+import com.twitter.scalatest.TestLogging
import com.twitter.util._
-import org.specs.Specification
+import org.scalatest._
-abstract class AbstractSpec extends Specification {
- val env = RuntimeEnvironment(this, Array("-f", "config/test.scala"))
+abstract class AbstractSpec extends FunSpec with TestLogging {
+ lazy val env = RuntimeEnvironment(this, Array("-f", "config/test.scala"))
lazy val birdName = {
val out = env.loadRuntimeConfig[BirdNameService.ThriftServer]
View
8 lib/template/src/test/scala/com/twitter/birdname/BirdNameServiceSpec.scala.erb
@@ -1,14 +1,14 @@
package com.twitter.birdname
class BirdNameServiceSpec extends AbstractSpec {
- "BirdNameService" should {
+ describe("BirdNameService") {
// TODO: Please implement your own tests.
- "set a key, get a key" in {
+ it("sets a key, then gets it") {
birdName.put("name", "bluebird")()
- birdName.get("name")() mustEqual "bluebird"
- birdName.get("what?")() must throwA[Exception]
+ assert(birdName.get("name")() === "bluebird")
+ intercept[Exception] { birdName.get("what?")() }
}
}
}
Please sign in to comment.
Something went wrong with that request. Please try again.