Evan You 12 лет назад
Родитель
Сommit
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 () {