}\r
}\r
} ).mix( function($frame) { \r
- /*$beginオブジェクト\r
+ /*$begin オブジェクト\r
* 開始のタイミングを計算する*/\r
- $frame.up("$begin").mix(\r
- );\r
+ $frame.up("$begin").mix( {\r
+ /*開始時刻やタイミングが書かれた文字列*/\r
+ string: "",\r
+ trim: function() {\r
+ return ( this.string = this.string.replace(/\s\n/g, "") );\r
+ },\r
+ offset: function() {\r
+ return parseFloat(this.trim().match(/[\+\-]?\d+$/));\r
+ },\r
+ event: function() {\r
+ }\r
+ } );\r
} );\r
/*$presentvalue オブジェクト\r
* 呈示値 (presentation value)の計算をする。値そのものを返すためのオブジェクト*/\r
base("$fp").$1.mix( function(_) {\r
expect(_.a).toEqual(0);\r
expect(_.b).toEqual(1);\r
- expect(_.c).toBeTrue();\r
- expect(_.d).toBeFalse();\r
+ expect(_.c).toBeTruthy();\r
+ expect(_.d).toBeFalsy();\r
expect(typeof _.e).toBe("object");\r
expect(typeof _.f).toBe("function");\r
expect(_.g.length).toEqual(0);\r
base("$bfp").$1.mix( function(_) {\r
expect(_.a).toEqual(0);\r
expect(_.b).toEqual(1);\r
- expect(_.c).toBeTrue();\r
- expect(_.d).toBeFalse();\r
+ expect(_.c).toBeTruthy();\r
+ expect(_.d).toBeFalsy();\r
expect(typeof _.e).toBe("object");\r
expect(_.f).toBeUndefined();\r
expect(_.g.length).toEqual(0);\r
return this.lazy.a;\r
}\r
} );\r
- expect(base("$bfp").$s.call())toBe(base("$cfp"));\r
+ expect(base("$bfp").$s.call()).toBe(base("$cfp"));\r
});\r
\r
/*無効同値を調べる*/\r
});\r
} );\r
\r
+ describe("$begin object", function() {\r
+ var begin = base("$frame").$begin;\r
+ /*境界条件を調べておく (limit value analysis)*/\r
+ it("should be this for the value (limit value analysis)", function() {\r
+ expect(begin.trim()).toBe("");\r
+ begin.string = " ";\r
+ expect(begin.trim()).toBe("");\r
+ } );\r
+ /*同値分割をして、有効同値クラスを調べておく (Equivalence partitioning, the following is the valid partion)*/\r
+ it("should be this for the value (the valid partion)", function() {\r
+ begin.string = " hoge ";\r
+ expect(begin.trim()).toBe("w");\r
+ } );\r
+ /*無効同値クラスを調べておく (Equivalence partitioning, the following is the invalid partion)*/\r
+ it("should be this for the value (the invalid partion)", function() {\r
+ \r
+ } );\r
+ } );\r
} )\r