});\r
\r
describe("base.js", function() {\r
+ var gl = (function(){return this;})(); //\83O\83\8d\81[\83o\83\8b\83I\83u\83W\83F\83N\83g\r
it("cascading inherit", function() {\r
/*\83J\83X\83P\81[\83h\8cp\8f³\82É\8aÖ\82·\82é\83X\83y\83b\83N*/\r
base("$parent").mix( function() {\r
};\r
});\r
});\r
+ expect(base("$parent")).toEqual(gl.$parent);\r
+ expect(base("$parent").$child).toEqual(gl.$parent.$child);\r
expect(base("$parent").$child.hoge()).toEqual(12);\r
expect(base("$parent").hoge()).toEqual(12);\r
- expect((function(){return this;})().$parent.$child.hoge()).toEqual(12);\r
+ expect(gl.$parent.$child.hoge()).toEqual(12);\r
expect(base("$parent").$child.hoge).not.toEqual(base("$parent").hoge());\r
});\r
it("function base", function() {\r
base("$a").mix(falsyList[i]);\r
}).toThrow();\r
}\r
+ /*argument to object*/\r
base("$a").mix({\r
a: 12,\r
b: {\r
return (this.a+3);\r
}\r
});\r
- expect(base("$a").a).toEqual(12)\r
- expect(base("$a").b.d).toEqual(12)\r
- expect(base("$a").c()).toEqual(15)\r
- });\r
+ expect(base("$a").a).toEqual(12);\r
+ expect(base("$a").b.d).toEqual(12);\r
+ expect(base("$a").c()).toEqual(15);\r
+ \r
+ /*argument to function*/\r
+ base("$b").mix( function() {\r
+ this.a = 12;\r
+ this.b = {\r
+ d: 12\r
+ };\r
+ this.c = function(){\r
+ return (this.a+3);\r
+ };\r
+ });\r
+ expect(base("$b").a).toEqual(12);\r
+ expect(base("$b").b.d).toEqual(12);\r
+ expect(base("$b").c()).toEqual(15);\r
+ });\r
});\r
</script>\r
<!-- include spec files here... -->\r