Skip to content

Commit

Permalink
Add a few simple tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
relrod committed Mar 19, 2012
1 parent fe87355 commit 5ed1535
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
3 changes: 2 additions & 1 deletion build.sbt
Expand Up @@ -9,5 +9,6 @@ scalacOptions += "-deprecation"
// resolvers += "Typesafe Repository" at "http://repo.typesafe.com/typesafe/releases/"

libraryDependencies ++= Seq(
"org.jsoup" % "jsoup" % "1.6.1"
"org.jsoup" % "jsoup" % "1.6.1",
"org.scalatest" %% "scalatest" % "1.7.1" % "test"
)
14 changes: 14 additions & 0 deletions src/test/scala/GoogleCalculatorSpec.scala
@@ -0,0 +1,14 @@
import org.scalatest.FunSpec
import me.elrod.GoogleCalculator._

class GoogleCalculatorSpec extends FunSpec {
describe("The library") {
it("should correctly retrieve the result of 2+2") {
assert(GoogleCalculator.calculate("2 + 2") == "2 + 2 = 4")
}

it("should correctly retrieve an approximation of Pi") {
assert(GoogleCalculator.calculate("pi").startsWith("pi = 3.1415"))
}
}
}

0 comments on commit 5ed1535

Please sign in to comment.