Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

better test for object property iteration

  • Loading branch information...
commit a3b377292c693dc37ba7f07d1363c0498adac15c 1 parent 8db0280
@rmurphey rmurphey authored
Showing with 9 additions and 5 deletions.
  1. +9 −5 tests/app/objects.js
View
14 tests/app/objects.js
@@ -43,14 +43,18 @@ define([ 'use!underscore' ], function(_) {
expect(new C('Ellie').greeting).to.be(greeting);
});
- it("you should be able to iterate over an object's properties", function() {
+ it("you should be able to iterate over an object's 'own' properties", function() {
// define a function for fn so that the following will pass
- var obj = {
- foo : 'bar',
- baz : 'bim'
+ var C = function() {
+ this.foo = 'bar';
+ this.baz = 'bim';
};
- expect(fn()).to.eql([ 'foo: bar', 'baz: bim' ]);
+ C.prototype.bop = 'bip';
+
+ var obj = new C();
+
+ expect(fn(obj)).to.eql([ 'foo: bar', 'baz: bim' ]);
});
});
});
Please sign in to comment.
Something went wrong with that request. Please try again.