-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbob_test.spec.js
91 lines (73 loc) · 2.62 KB
/
bob_test.spec.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
var people = require("./bob");
var Bob = people.Bob
describe("TeenagerTest", function(){
var teenager = new Bob();
it("stating something", function(){
var response = teenager.hey("Tom-ay-to, tom-aaah-to.");
expect(response).toBe("Whatever.");
});
it("shouting", function(){
var response = teenager.hey("WATCH OUT!");
expect(response).toBe("Woah, chill out!");
});
it("asking a question", function(){
var response = teenager.hey("Does this cryogenic chamber make me look fat?");
expect(response).toBe("Sure.");
});
it("asking a numeric question", function(){
var response = teenager.hey("You are, what, like 15?");
expect(response).toBe("Sure.");
});
it("is talking forcefully", function(){
var response = teenager.hey("Let's go make out behind the gym!");
expect(response).toBe("Whatever.");
});
it("is asking a forceful question", function(){
var response = teenager.hey("WHAT THE HELL WERE YOU THINKING?");
expect(response).toBe("Woah, chill out!");
});
it("is shouting numbers", function(){
var response = teenager.hey("1, 2, 3 GO!");
expect(response).toBe("Woah, chill out!");
});
xit("is only saying numbers", function(){
var response = teenager.hey("1, 2, 3");
expect(response).toBe("Whatever.");
});
xit("question with only numbers", function() {
var result = teenager.hey('4?');
expect(result).toEqual('Sure.');
});
xit("shouting with special characters", function() {
var result = teenager.hey('ZOMG THE %^*@#$(*^ ZOMBIES ARE COMING!!11!!1!');
expect(result).toEqual('Woah, chill out!');
});
xit("shouting with umlauts", function() {
var result = teenager.hey("\xdcML\xc4\xdcTS!");
expect(result).toEqual('Woah, chill out!');
});
xit("calmly speaking about umlauts", function() {
var result = teenager.hey("\xdcML\xe4\xdcTS!");
expect(result).toEqual('Whatever.');
});
xit("shouting with no exclamation mark", function () {
var result = teenager.hey('I HATE YOU');
expect(result).toEqual('Woah, chill out!');
});
xit("statement containing question mark", function() {
var result = teenager.hey('Ending with a ? means a question.');
expect(result).toEqual('Whatever.');
});
xit("prattling on", function () {
var result = teenager.hey('Wait! Hang on. Are you going to be OK?');
expect(result).toEqual('Sure.');
});
xit("silence", function () {
var result = teenager.hey('');
expect(result).toEqual('Fine. Be that way!');
});
xit("prolonged silence", function () {
var result = teenager.hey(' ');
expect(result).toEqual('Fine. Be that way!');
});
});