Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

About Expects, Arrays, Functions, and Objects completed #53

Closed
wants to merge 10 commits into from
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
About Mutability completed
  • Loading branch information
Florence Truong committed Jul 22, 2015
commit ef000dc68d6cf46f57e686417879d8920512a9a6
16 changes: 8 additions & 8 deletions koans/AboutMutability.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ describe("About Mutability", function() {
var aPerson = {firstname: "John", lastname: "Smith" };
aPerson.firstname = "Alan";

expect(aPerson.firstname).toBe(FILL_ME_IN);
expect(aPerson.firstname).toBe("Alan");
});

it("should understand that constructed properties are public and mutable", function () {
Expand All @@ -16,7 +16,7 @@ describe("About Mutability", function() {
var aPerson = new Person ("John", "Smith");
aPerson.firstname = "Alan";

expect(aPerson.firstname).toBe(FILL_ME_IN);
expect(aPerson.firstname).toBe("Alan");
});

it("should expect prototype properties to be public and mutable", function () {
Expand All @@ -30,13 +30,13 @@ describe("About Mutability", function() {
};

var aPerson = new Person ("John", "Smith");
expect(aPerson.getFullName()).toBe(FILL_ME_IN);
expect(aPerson.getFullName()).toBe("John Smith");

aPerson.getFullName = function () {
return this.lastname + ", " + this.firstname;
};

expect(aPerson.getFullName()).toBe(FILL_ME_IN);
expect(aPerson.getFullName()).toBe("Smith, John");
});

it("should know that variables inside a constructor and constructor args are private", function () {
Expand All @@ -54,15 +54,15 @@ describe("About Mutability", function() {
aPerson.lastname = "Andrews";
aPerson.fullName = "Penny Andrews";

expect(aPerson.getFirstName()).toBe(FILL_ME_IN);
expect(aPerson.getLastName()).toBe(FILL_ME_IN);
expect(aPerson.getFullName()).toBe(FILL_ME_IN);
expect(aPerson.getFirstName()).toBe("John");
expect(aPerson.getLastName()).toBe("Smith");
expect(aPerson.getFullName()).toBe("John Smith");

aPerson.getFullName = function () {
return aPerson.lastname + ", " + aPerson.firstname;
};

expect(aPerson.getFullName()).toBe(FILL_ME_IN);
expect(aPerson.getFullName()).toBe("Andrews, Penny");
});

});