Created
March 12, 2011 18:05
-
-
Save benedikt/867418 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var Sample = function() { | |
var iamHidden = "you can't see me!"; | |
this.lookInside = function() { | |
return iamHidden; | |
}; | |
}; | |
describe("Sample", function() { | |
it("should be equal", function() { | |
var a = new Sample(), b = new Sample(); | |
expect(a).toEqual(b); // => fails | |
}); | |
}); | |
// It fails because a.lookInside !== b.lookInside, but what would be the correct way to implement privileged methods then? |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment