Skip to content

Instantly share code, notes, and snippets.

@dkowis
Created July 24, 2014 02:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dkowis/2fdd4f4c6f069327e6a1 to your computer and use it in GitHub Desktop.
Save dkowis/2fdd4f4c6f069327e6a1 to your computer and use it in GitHub Desktop.
import org.scalatest.{Matchers, FunSpec}
class RomanTest extends FunSpec with Matchers {
val testCases = Map(
"CCXCI" -> 291
)
describe("Converting arabic numerals to roman numerals") {
describe("Defining the range of our problem") {
it("converts the smallest: 1") {
pending
}
it("converts the largest: 3999") {
pending
}
}
describe("Defining a few test cases") {
testCases.map(_.swap).foreach { case (arabic: Int, roman: String) =>
it(s"converts $arabic to $roman") {
pending
}
}
}
}
describe("Converting roman numerals to arabic numerals") {
describe("Defining the range of our problem") {
it("converts the smallest: I") {
pending
}
it("converts the largest: MMMCMXCIX") {
//I Think?
pending
}
}
describe("defining a few test cases") {
testCases.foreach { case (roman: String, arabic: Int) =>
it(s"converts $roman to $arabic") {
pending
}
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment