Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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