Skip to content

Instantly share code, notes, and snippets.

@benedikt
Created March 12, 2011 18:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save benedikt/867418 to your computer and use it in GitHub Desktop.
Save benedikt/867418 to your computer and use it in GitHub Desktop.
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