Skip to content
Browse files

Add alphabets and failing acceptance test

  • Loading branch information...
1 parent f708be6 commit 060f5efc7e62d5b1698aaa2351bea35114a5a660 @iwein iwein committed Feb 14, 2012
View
14 src/main/scala/org/iwein/enigma/Alphabets.scala
@@ -0,0 +1,14 @@
+package org.iwein.enigma
+
+/**
+ * @author iwein
+ */
+
+trait Alphabets {
+
+ val realAlphabet = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
+
+ val alphabetI = "EKMFLGDQVZNTOWYHXUSPAIBRCJ"
+ val alphabetII = "AJDKSIRUXBLHWTMCQGZNPYFVOE"
+ val alphabetIII = "BDFHJLCPRTXVZNYEIWGAKMUSQO"
+}
View
28 src/test/scala/org/iwein/enigma/EnigmaAcceptanceTest.scala
@@ -0,0 +1,28 @@
+package org.iwein.enigma
+
+import org.specs2._
+import execute.Result
+
+/**
+ * @author iwein
+ */
+
+class EnigmaAcceptanceTests extends Specification with Alphabets {
+ def is =
+ "This is a specification of the outside behavior of an Enigma machine" ^
+ p ^
+ "an Enigma machine should " ^
+ "transform plain text to cipher " ! toCipher ^
+ "transform cipher to plain text" ! toCipher
+ end
+
+ val plainText = "ENIGMA REVEALED"
+ val cipherText = "QMJIDO MZWZJDMG"
+
+ def toCipher : Result = {
+ failure
+ }
+ def toPlain : Result = {
+ failure
+ }
+}

0 comments on commit 060f5ef

Please sign in to comment.
Something went wrong with that request. Please try again.