1 | describe("Class Properties", function() {
|
2 |
|
3 | it("extend() should create a valid subclass", function() {
|
4 | var SubTemple = Temple.extend({
|
5 | foo: function(){}
|
6 | });
|
7 |
|
8 | var tpl = new SubTemple();
|
9 |
|
10 | expect(tpl).to.be.instanceof(Temple);
|
11 | expect(tpl.foo).to.be.a("function");
|
12 | });
|
13 |
|
14 | it("subclass with defaults should make instances with defaults", function() {
|
15 | var val = { foo: "bar" };
|
16 |
|
17 | var SubTemple = Temple.extend({
|
18 | defaults: { foo: "bar" }
|
19 | });
|
20 |
|
21 | var tpl = new SubTemple();
|
22 |
|
23 | expect(tpl.get()).to.deep.equal({ foo: "bar" });
|
24 | expect(tpl.get()).to.not.equal(val);
|
25 | expect(tpl.get("foo")).to.equal("bar");
|
26 | });
|
27 |
|
28 | }); |
\ | No newline at end of file |