Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Upgrade to simplespec 0.3.3.

  • Loading branch information...
commit 4c45a2098d5616e9ff694e0f90e16ae15c454cd2 1 parent ab2c7d3
Coda Hale codahale authored
4 README.md
View
@@ -19,11 +19,11 @@ Make sure you have [simple-build-tool](http://code.google.com/p/simple-build-too
The `sbt assembly` command uses [assembly-sbt](https://github.com/codahale/assembly-sbt) (included with dropwizard)
to handle the hard work. That JAR should end up somewhere like
- `target/scala_2.8.1/dropwizard-example-assembly-1.0-OVERHAUL-SNAPSHOT.jar`
+ `target/scala_2.8.1/dropwizard-example-assembly-1.0-SNAPSHOT.jar`
4. Start the HTTP server, using the provided configuration file.
- java -jar target/scala_2.8.1/dropwizard-example-assembly-1.0-OVERHAUL-SNAPSHOT.jar server example.conf.template
+ java -jar target/scala_2.8.1/dropwizard-example-assembly-1.0-SNAPSHOT.jar server example.conf.template
5. Open up your browser and point it at `http://localhost:8080/hello-world`.
Boom.
4 project/build.properties
View
@@ -2,7 +2,7 @@
#Thu Nov 04 15:26:43 PDT 2010
project.organization=com.yammer
project.name=dropwizard-example
-sbt.version=0.7.5.RC0
-project.version=1.0-OVERHAUL-SNAPSHOT
+sbt.version=0.7.7
+project.version=1.0-SNAPSHOT
build.scala.versions=2.8.1
project.initialize=false
5 project/build/DropWizardExampleProject.scala
View
@@ -29,8 +29,9 @@ class DropWizardExampleProject(info: ProjectInfo) extends DefaultProject(info)
/**
* Test Dependencies
*/
- val simplespec = "com.codahale" %% "simplespec" % "0.2.0" % "test"
- val mockito = "org.mockito" % "mockito-all" % "1.8.4" % "test"
+ val simplespec = "com.codahale" %% "simplespec" % "0.3.3" % "test"
+ def specs2Framework = new TestFramework("org.specs2.runner.SpecsFramework")
+ override def testFrameworks = super.testFrameworks ++ Seq(specs2Framework)
override def fork = forkRun(List(
"-server", // make sure we're using the 64-bit server VM
12 src/test/scala/com/example/config/tests/TemplateFactorySpec.scala
View
@@ -8,7 +8,7 @@ import com.yammer.example.config.TemplateFactory
object TemplateFactorySpec extends Spec {
class `A config file with a template and a default name` {
- implicit val config = new Configuration(Source.fromString("""
+ private implicit val config = new Configuration(Source.fromString("""
{
"example": {
"template": "Hello there %s.",
@@ -17,13 +17,13 @@ object TemplateFactorySpec extends Spec {
}
"""))
- def `should produce a template with a default name` {
+ def `should produce a template with a default name` = {
TemplateFactory.buildTemplate must beEqualTo(Template("Hello there %s.", "dude"))
}
}
class `A config file with a template and no default name` {
- implicit val config = new Configuration(Source.fromString("""
+ private implicit val config = new Configuration(Source.fromString("""
{
"example": {
"template": "Hello there %s."
@@ -33,13 +33,13 @@ object TemplateFactorySpec extends Spec {
)
)
- def `should produce a template with a default name` {
+ def `should produce a template with a default name` = {
TemplateFactory.buildTemplate must beEqualTo(Template("Hello there %s.", "Stranger"))
}
}
class `A config file with no template` {
- implicit val config = new Configuration(Source.fromString("""
+ private implicit val config = new Configuration(Source.fromString("""
{
"example": {
}
@@ -48,7 +48,7 @@ object TemplateFactorySpec extends Spec {
)
)
- def `should throw an exception` {
+ def `should throw an exception` = {
TemplateFactory.buildTemplate must throwA[ConfigurationException]
}
}
6 src/test/scala/com/example/data/tests/SayingSpec.scala
View
@@ -5,13 +5,13 @@ import com.yammer.example.data.Saying
object SayingSpec extends Spec {
class `A saying` {
- val saying = Saying(1, "yay")
+ private val saying = Saying(1, "yay")
- def `should have an ID` {
+ def `should have an ID` = {
saying.id must beEqualTo(1)
}
- def `should have content` {
+ def `should have content` = {
saying.content must beEqualTo("yay")
}
}
10 src/test/scala/com/example/data/tests/TemplateSpec.scala
View
@@ -5,21 +5,21 @@ import com.yammer.example.data.Template
object TemplateSpec extends Spec {
class `A template` {
- val template = Template("Hello there %s.", "stranger")
+ private val template = Template("Hello there %s.", "stranger")
- def `should have a template` {
+ def `should have a template` = {
template.template must beEqualTo("Hello there %s.")
}
- def `should have a default name` {
+ def `should have a default name` = {
template.defaultName must beEqualTo("stranger")
}
- def `should render the template` {
+ def `should render the template` = {
template(Some("Frank")) must beEqualTo("Hello there Frank.")
}
- def `should render the template using the default name` {
+ def `should render the template using the default name` = {
template(None) must beEqualTo("Hello there stranger.")
}
}
8 src/test/scala/com/example/resources/test/HelloWorldResourceSpec.scala
View
@@ -6,15 +6,15 @@ import com.yammer.example.data.{Saying, Template}
object HelloWorldResourceSpec extends Spec {
class `Saying hello to the world` {
- implicit val template = Template("Hello there %s.", "stranger")
- val resource = new HelloWorldResource
+ private implicit val template = Template("Hello there %s.", "stranger")
+ private val resource = new HelloWorldResource
- def `should return a saying with a unique ID` {
+ def `should return a saying with a unique ID` = {
resource.sayHello(None) must beEqualTo(Saying(1, "Hello there stranger."))
resource.sayHello(None) must beEqualTo(Saying(2, "Hello there stranger."))
}
- def `should use a specific name if one is given` {
+ def `should use a specific name if one is given` = {
resource.sayHello(Some("Frank")) must beEqualTo(Saying(1, "Hello there Frank."))
}
}
Please sign in to comment.
Something went wrong with that request. Please try again.