Skip to content

Commit

Permalink
Update bob exercise to match the latest test data. Refs exercism#488
Browse files Browse the repository at this point in the history
  • Loading branch information
ricemery committed Jan 1, 2019
1 parent 85edf4c commit fd93c49
Showing 1 changed file with 35 additions and 30 deletions.
65 changes: 35 additions & 30 deletions exercises/bob/src/test/scala/BobTest.scala
Original file line number Diff line number Diff line change
@@ -1,133 +1,138 @@
import org.scalatest.{Matchers, FunSuite}

/** @version 1.2.0 */
/** @version 1.4.0 */
class BobTest extends FunSuite with Matchers {


test("stating something") {
Bob.response("Tom-ay-to, tom-aaaah-to.") should be ("Whatever.")
Bob.response("Tom-ay-to, tom-aaaah-to.") should be("Whatever.")
}

test("shouting") {
pending
Bob.response("WATCH OUT!") should be ("Whoa, chill out!")
Bob.response("WATCH OUT!") should be("Whoa, chill out!")
}

test("shouting gibberish") {
pending
Bob.response("FCECDFCAAB") should be ("Whoa, chill out!")
Bob.response("FCECDFCAAB") should be("Whoa, chill out!")
}

test("asking a question") {
pending
Bob.response("Does this cryogenic chamber make me look fat?") should be ("Sure.")
Bob.response("Does this cryogenic chamber make me look fat?") should be(
"Sure.")
}

test("asking a numeric question") {
pending
Bob.response("You are, what, like 15?") should be ("Sure.")
Bob.response("You are, what, like 15?") should be("Sure.")
}

test("asking gibberish") {
pending
Bob.response("fffbbcbeab?") should be ("Sure.")
Bob.response("fffbbcbeab?") should be("Sure.")
}

test("talking forcefully") {
pending
Bob.response("Let's go make out behind the gym!") should be ("Whatever.")
Bob.response("Let's go make out behind the gym!") should be("Whatever.")
}

test("using acronyms in regular speech") {
pending
Bob.response("It's OK if you don't want to go to the DMV.") should be ("Whatever.")
Bob.response("It's OK if you don't want to go to the DMV.") should be(
"Whatever.")
}

test("forceful question") {
pending
Bob.response("WHAT THE HELL WERE YOU THINKING?") should be ("Calm down, I know what I'm doing!")
Bob.response("WHAT THE HELL WERE YOU THINKING?") should be(
"Calm down, I know what I'm doing!")
}

test("shouting numbers") {
pending
Bob.response("1, 2, 3 GO!") should be ("Whoa, chill out!")
Bob.response("1, 2, 3 GO!") should be("Whoa, chill out!")
}

test("only numbers") {
test("no letters") {
pending
Bob.response("1, 2, 3") should be ("Whatever.")
Bob.response("1, 2, 3") should be("Whatever.")
}

test("question with only numbers") {
test("question with no letters") {
pending
Bob.response("4?") should be ("Sure.")
Bob.response("4?") should be("Sure.")
}

test("shouting with special characters") {
pending
Bob.response("ZOMG THE %^*@#$(*^ ZOMBIES ARE COMING!!11!!1!") should be ("Whoa, chill out!")
Bob.response("ZOMG THE %^*@#$(*^ ZOMBIES ARE COMING!!11!!1!") should be(
"Whoa, chill out!")
}

test("shouting with no exclamation mark") {
pending
Bob.response("I HATE YOU") should be ("Whoa, chill out!")
Bob.response("I HATE THE DMV") should be("Whoa, chill out!")
}

test("statement containing question mark") {
pending
Bob.response("Ending with ? means a question.") should be ("Whatever.")
Bob.response("Ending with ? means a question.") should be("Whatever.")
}

test("non-letters with question") {
pending
Bob.response(":) ?") should be ("Sure.")
Bob.response(":) ?") should be("Sure.")
}

test("prattling on") {
pending
Bob.response("Wait! Hang on. Are you going to be OK?") should be ("Sure.")
Bob.response("Wait! Hang on. Are you going to be OK?") should be("Sure.")
}

test("silence") {
pending
Bob.response("") should be ("Fine. Be that way!")
Bob.response("") should be("Fine. Be that way!")
}

test("prolonged silence") {
pending
Bob.response(" ") should be ("Fine. Be that way!")
Bob.response(" ") should be("Fine. Be that way!")
}

test("alternate silence") {
pending
Bob.response(" ") should be ("Fine. Be that way!")
Bob.response(" ") should be("Fine. Be that way!")
}

test("multiple line question") {
pending
Bob.response("""
Does this cryogenic chamber make me look fat?
no""") should be ("Whatever.")
No.""") should be("Whatever.")
}

test("starting with whitespace") {
pending
Bob.response(" hmmmmmmm...") should be ("Whatever.")
Bob.response(" hmmmmmmm...") should be("Whatever.")
}

test("ending with whitespace") {
pending
Bob.response("Okay if like my spacebar quite a bit? ") should be ("Sure.")
Bob.response("Okay if like my spacebar quite a bit? ") should be(
"Sure.")
}

test("other whitespace") {
pending
Bob.response("""
""") should be ("Fine. Be that way!")
""") should be("Fine. Be that way!")
}

test("non-question ending with whitespace") {
pending
Bob.response("This is a statement ending with whitespace ") should be ("Whatever.")
Bob.response("This is a statement ending with whitespace ") should be(
"Whatever.")
}
}
}

0 comments on commit fd93c49

Please sign in to comment.