summaryrefslogtreecommitdiff
path: root/test/specs/helpers/bind.spec.js
diff options
context:
space:
mode:
Diffstat (limited to 'test/specs/helpers/bind.spec.js')
-rw-r--r--test/specs/helpers/bind.spec.js12
1 files changed, 12 insertions, 0 deletions
diff --git a/test/specs/helpers/bind.spec.js b/test/specs/helpers/bind.spec.js
new file mode 100644
index 0000000..a02c462
--- /dev/null
+++ b/test/specs/helpers/bind.spec.js
@@ -0,0 +1,12 @@
+var bind = require('../../../lib/helpers/bind');
+
+describe('bind', function () {
+ it('should bind an object to a function', function () {
+ var o = { val: 123 };
+ var f = bind(function (num) {
+ return this.val * num;
+ }, o);
+
+ expect(f(2)).toEqual(246);
+ });
+});