Skip to content

Commit e255ee5

Browse files
committed
about_prototypal_inheritance
1 parent a9e0180 commit e255ee5

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

topics/about_prototypal_inheritance.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ Mammal.prototype = {
1616

1717
test("defining a 'class'", function() {
1818
var eric = new Mammal("Eric");
19-
equals(eric.sayHi(), __, 'what will Eric say?');
19+
equals(eric.sayHi(), "Hello, my name is Eric", 'what will Eric say?');
2020
});
2121

2222
// add another function to the Mammal 'type' that uses the sayHi function
@@ -26,7 +26,7 @@ Mammal.prototype.favouriteSaying = function() {
2626

2727
test("more functions", function() {
2828
var bobby = new Mammal("Bobby");
29-
equals(bobby.favouriteSaying(), __, "what is Bobby's favourite saying?");
29+
equals(bobby.favouriteSaying(), "Bobby's favourite saying is Hello, my name is Bobby", "what is Bobby's favourite saying?");
3030
});
3131

3232
test("calling functions added to a prototype after an object was created", function() {
@@ -36,7 +36,7 @@ test("calling functions added to a prototype after an object was created", funct
3636
};
3737
// the following statement asks the paul object to call a function that was added
3838
// to the Mammal prototype after paul was constructed.
39-
equals(paul.numberOfLettersInName(), __, "how long is Paul's name?");
39+
equals(paul.numberOfLettersInName(), 4, "how long is Paul's name?");
4040
});
4141

4242
// helper function for inheritance.
@@ -56,6 +56,6 @@ extend(Bat, Mammal);
5656

5757
test("Inheritance", function() {
5858
var lenny = new Bat("Lenny", "1.5m");
59-
equals(lenny.sayHi(), __, "what does Lenny say?");
60-
equals(lenny.wingspan, __, "what is Lenny's wingspan?");
59+
equals(lenny.sayHi(), "Hello, my name is Lenny", "what does Lenny say?");
60+
equals(lenny.wingspan, "1.5m", "what is Lenny's wingspan?");
6161
});

0 commit comments

Comments
 (0)