Преглед изворни кода

unit test for utils.bind()

Evan You пре 12 година
родитељ
комит
bf73f08a8a
1 измењених фајлова са 13 додато и 0 уклоњено
  1. 13 0
      test/unit/specs/utils.js

+ 13 - 0
test/unit/specs/utils.js

@@ -143,6 +143,19 @@ describe('UNIT: Utils', function () {
 
     })
 
+
+    describe('bind', function () {
+        
+        it('should bind the right context', function () {
+            function test () {
+                return this + 1
+            }
+            var bound = utils.bind(test, 2)
+            assert.strictEqual(bound(), 3)
+        })
+
+    })
+
     describe('toFragment', function () {
         
         it('should convert a string tempalte to a documentFragment', function () {