expect(file[4]).toEqual("5678");\r
expect(file.write("30d")).toEqual("30d");\r
});\r
+ var f;\r
+ beforeEach(function() {\r
+ f = function() {};\r
+ });\r
it("default property", function() {\r
- var f = function() {};\r
expect(f.open("a")).toEqual(f);\r
});\r
+ it("error check", function() {\r
+ expect(function() {\r
+ f.oepn();\r
+ }).toThrow();\r
+ expect(function() {\r
+ f.oepn("");\r
+ }).toThrow();\r
+ expect(function() {\r
+ f.oepn(["y"]);\r
+ }).toThrow();\r
+ expect(function() {\r
+ f.oepn({x:"x"});\r
+ }).toThrow();\r
+ });\r
});\r
__start_();\r
};\r
\r
if (!Function.prototype.open) {\r
Function.prototype.open = function() {\r
- if (typeof arguments[0] !== "string") {\r
+ if (!arguments[0] && (typeof arguments[0] !== "string")) {\r
throw new Error("no arguments error");\r
}\r
var that = this, // Callback Function\r