Skip to content

Commit 9b4b24b

Browse files
committed
My first tests on Cloud9IDE
1 parent dc809f3 commit 9b4b24b

5 files changed

Lines changed: 21 additions & 19 deletions

File tree

topics/about_asserts.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,13 @@
22
module("About Asserts (topics/about_asserts.js)");
33

44
test("ok", function() {
5-
ok(__, 'what will satisfy the ok assertion?');
5+
ok(ok, 'what will satisfy the ok assertion?');
66
});
77

88
test("not", function() {
9-
not(__, 'what is a false value?');
9+
not(false, 'what is a false value?');
1010
});
1111

1212
test("equals", function() {
13-
equals(1+1, __, 'what will satisfy the equals assertion?');
13+
equals(1+1, 2, 'what will satisfy the equals assertion?');
1414
});

topics/about_assignment.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@
22
module("About Assignment (topics/about_assignment.js)");
33

44
test("local variables", function() {
5-
var temp = __;
5+
var temp = 1;
66
equals(1, temp, "Assign a value to the variable temp");
77
});
88

99
test("global variables", function() {
1010
temp = 1;
11-
equals(temp, window.__, 'global variables are assigned to the window object');
11+
equals(temp, window.temp, 'global variables are assigned to the window object');
1212
});

topics/about_equality.js

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,23 @@
11

2+
23
module("About Equality (topics/about_equality.js)");
34

45
test("numeric equality", function() {
5-
equals(3 + __, 7, 'hmmmm?');
6+
equals(3 + 4, 7, 'hmmmm?');
67
});
78

89
test("string equality", function() {
9-
equals("3" + __, "37", "concatenate the strings");
10+
equals("3" + "7", "37", "concatenate the strings");
1011
});
1112

1213
test("equality without type coercion", function() {
13-
ok(3 === __, 'what is exactly equal to 3?');
14+
ok(3 === 3, 'what is exactly equal to 3?');
1415
});
1516

1617
test("equality with type coercion", function() {
17-
ok(3 == "__", 'what string is equal to 3, with type coercion?');
18+
ok(3 == "3", 'what string is equal to 3, with type coercion?');
1819
});
1920

2021
test("string literals", function() {
21-
equals("frankenstein", '__', "quote types are interchangable, but must match.");
22+
equals("frankenstein", 'frankenstein', "quote types are interchangable, but must match.");
2223
});

topics/about_operators.js

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11

2+
23
module("About Operators (topics/about_operators.js)");
34

45
test("addition", function() {
@@ -7,7 +8,7 @@ test("addition", function() {
78
for (var i = 0; i <= 5; i++) {
89
result = result + i;
910
}
10-
equals(result, __, "What is the value of result?");
11+
equals(result, 15, "What is the value of result?");
1112
});
1213

1314
test("assignment addition", function() {
@@ -16,23 +17,23 @@ test("assignment addition", function() {
1617
//the code below is just like saying result = result + i; but is more concise
1718
result += i;
1819
}
19-
equals(result, __, "What is the value of result?");
20+
equals(result, 15, "What is the value of result?");
2021
});
2122

2223
test("subtraction", function() {
2324
var result = 5;
2425
for (var i = 0; i <= 2; i++) {
2526
result = result - i;
2627
}
27-
equals(result, __, "What is the value of result?");
28+
equals(result, 2 , "What is the value of result?");
2829
});
2930

3031
test("assignment subtraction", function() {
3132
var result = 5;
3233
for (var i = 0; i <= 2; i++) {
3334
result -= i;
3435
}
35-
equals(result, __, "What is the value of result?");
36+
equals(result, 2, "What is the value of result?");
3637
});
3738

3839
//Assignment operators are available for multiplication and division as well
@@ -43,5 +44,5 @@ test("modulus", function() {
4344
var x = 5;
4445
//again this is exactly the same as result = result % x
4546
result %= x;
46-
equals(result, __, "What is the value of result?");
47+
equals(result, 0, "What is the value of result?");
4748
});

topics/about_truthyness.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,20 +3,20 @@ module("About Truthyness (topics/about_truthyness.js)");
33

44
test("truthyness of positive numbers", function() {
55
var oneIsTruthy = 1 ? true : false;
6-
equals(oneIsTruthy, __, 'is one truthy?');
6+
equals(oneIsTruthy, true, 'is one truthy?');
77
});
88

99
test("truthyness of negative numbers", function() {
1010
var negativeOneIsTruthy = -1 ? true : false;
11-
equals(negativeOneIsTruthy, __, 'is -1 truthy?');
11+
equals(negativeOneIsTruthy, true, 'is -1 truthy?');
1212
});
1313

1414
test("truthyness of zero", function() {
1515
var zeroIsTruthy = 0 ? true : false;
16-
equals(zeroIsTruthy, __, 'is 0 truthy?');
16+
equals(zeroIsTruthy, false, 'is 0 truthy?');
1717
});
1818

1919
test("truthyness of null", function() {
2020
var nullIsTruthy = null ? true : false;
21-
equals(nullIsTruthy, __, 'is null truthy?');
21+
equals(nullIsTruthy, false, 'is null truthy?');
2222
});

0 commit comments

Comments
 (0)