Skip to content

Commit fd93c49

Browse files
committedJan 1, 2019
Update bob exercise to match the latest test data. Refs exercism#488
1 parent 85edf4c commit fd93c49

File tree

1 file changed

+35
-30
lines changed

1 file changed

+35
-30
lines changed
 
+35-30
Original file line numberDiff line numberDiff line change
@@ -1,133 +1,138 @@
11
import org.scalatest.{Matchers, FunSuite}
22

3-
/** @version 1.2.0 */
3+
/** @version 1.4.0 */
44
class BobTest extends FunSuite with Matchers {
55

6-
76
test("stating something") {
8-
Bob.response("Tom-ay-to, tom-aaaah-to.") should be ("Whatever.")
7+
Bob.response("Tom-ay-to, tom-aaaah-to.") should be("Whatever.")
98
}
109

1110
test("shouting") {
1211
pending
13-
Bob.response("WATCH OUT!") should be ("Whoa, chill out!")
12+
Bob.response("WATCH OUT!") should be("Whoa, chill out!")
1413
}
1514

1615
test("shouting gibberish") {
1716
pending
18-
Bob.response("FCECDFCAAB") should be ("Whoa, chill out!")
17+
Bob.response("FCECDFCAAB") should be("Whoa, chill out!")
1918
}
2019

2120
test("asking a question") {
2221
pending
23-
Bob.response("Does this cryogenic chamber make me look fat?") should be ("Sure.")
22+
Bob.response("Does this cryogenic chamber make me look fat?") should be(
23+
"Sure.")
2424
}
2525

2626
test("asking a numeric question") {
2727
pending
28-
Bob.response("You are, what, like 15?") should be ("Sure.")
28+
Bob.response("You are, what, like 15?") should be("Sure.")
2929
}
3030

3131
test("asking gibberish") {
3232
pending
33-
Bob.response("fffbbcbeab?") should be ("Sure.")
33+
Bob.response("fffbbcbeab?") should be("Sure.")
3434
}
3535

3636
test("talking forcefully") {
3737
pending
38-
Bob.response("Let's go make out behind the gym!") should be ("Whatever.")
38+
Bob.response("Let's go make out behind the gym!") should be("Whatever.")
3939
}
4040

4141
test("using acronyms in regular speech") {
4242
pending
43-
Bob.response("It's OK if you don't want to go to the DMV.") should be ("Whatever.")
43+
Bob.response("It's OK if you don't want to go to the DMV.") should be(
44+
"Whatever.")
4445
}
4546

4647
test("forceful question") {
4748
pending
48-
Bob.response("WHAT THE HELL WERE YOU THINKING?") should be ("Calm down, I know what I'm doing!")
49+
Bob.response("WHAT THE HELL WERE YOU THINKING?") should be(
50+
"Calm down, I know what I'm doing!")
4951
}
5052

5153
test("shouting numbers") {
5254
pending
53-
Bob.response("1, 2, 3 GO!") should be ("Whoa, chill out!")
55+
Bob.response("1, 2, 3 GO!") should be("Whoa, chill out!")
5456
}
5557

56-
test("only numbers") {
58+
test("no letters") {
5759
pending
58-
Bob.response("1, 2, 3") should be ("Whatever.")
60+
Bob.response("1, 2, 3") should be("Whatever.")
5961
}
6062

61-
test("question with only numbers") {
63+
test("question with no letters") {
6264
pending
63-
Bob.response("4?") should be ("Sure.")
65+
Bob.response("4?") should be("Sure.")
6466
}
6567

6668
test("shouting with special characters") {
6769
pending
68-
Bob.response("ZOMG THE %^*@#$(*^ ZOMBIES ARE COMING!!11!!1!") should be ("Whoa, chill out!")
70+
Bob.response("ZOMG THE %^*@#$(*^ ZOMBIES ARE COMING!!11!!1!") should be(
71+
"Whoa, chill out!")
6972
}
7073

7174
test("shouting with no exclamation mark") {
7275
pending
73-
Bob.response("I HATE YOU") should be ("Whoa, chill out!")
76+
Bob.response("I HATE THE DMV") should be("Whoa, chill out!")
7477
}
7578

7679
test("statement containing question mark") {
7780
pending
78-
Bob.response("Ending with ? means a question.") should be ("Whatever.")
81+
Bob.response("Ending with ? means a question.") should be("Whatever.")
7982
}
8083

8184
test("non-letters with question") {
8285
pending
83-
Bob.response(":) ?") should be ("Sure.")
86+
Bob.response(":) ?") should be("Sure.")
8487
}
8588

8689
test("prattling on") {
8790
pending
88-
Bob.response("Wait! Hang on. Are you going to be OK?") should be ("Sure.")
91+
Bob.response("Wait! Hang on. Are you going to be OK?") should be("Sure.")
8992
}
9093

9194
test("silence") {
9295
pending
93-
Bob.response("") should be ("Fine. Be that way!")
96+
Bob.response("") should be("Fine. Be that way!")
9497
}
9598

9699
test("prolonged silence") {
97100
pending
98-
Bob.response(" ") should be ("Fine. Be that way!")
101+
Bob.response(" ") should be("Fine. Be that way!")
99102
}
100103

101104
test("alternate silence") {
102105
pending
103-
Bob.response(" ") should be ("Fine. Be that way!")
106+
Bob.response(" ") should be("Fine. Be that way!")
104107
}
105108

106109
test("multiple line question") {
107110
pending
108111
Bob.response("""
109112
Does this cryogenic chamber make me look fat?
110-
no""") should be ("Whatever.")
113+
No.""") should be("Whatever.")
111114
}
112115

113116
test("starting with whitespace") {
114117
pending
115-
Bob.response(" hmmmmmmm...") should be ("Whatever.")
118+
Bob.response(" hmmmmmmm...") should be("Whatever.")
116119
}
117120

118121
test("ending with whitespace") {
119122
pending
120-
Bob.response("Okay if like my spacebar quite a bit? ") should be ("Sure.")
123+
Bob.response("Okay if like my spacebar quite a bit? ") should be(
124+
"Sure.")
121125
}
122126

123127
test("other whitespace") {
124128
pending
125129
Bob.response("""
126-
""") should be ("Fine. Be that way!")
130+
""") should be("Fine. Be that way!")
127131
}
128132

129133
test("non-question ending with whitespace") {
130134
pending
131-
Bob.response("This is a statement ending with whitespace ") should be ("Whatever.")
135+
Bob.response("This is a statement ending with whitespace ") should be(
136+
"Whatever.")
132137
}
133-
}
138+
}

0 commit comments

Comments
 (0)
Please sign in to comment.