Rename _.lateBind to _.bindKey. [closes #114]

Former-commit-id: 971e56cb86b5298ba2a9f92365f0463665d27230
This commit is contained in:
John-David Dalton
2012-11-17 00:06:55 -08:00
parent f2f980928b
commit 25e1eb3ce9
7 changed files with 192 additions and 192 deletions

View File

@@ -213,6 +213,29 @@
/*--------------------------------------------------------------------------*/
QUnit.module('lodash.bindKey');
(function() {
test('should work when the target function is overwritten', function() {
var object = {
'name': 'moe',
'greet': function(greeting) {
return greeting + ': ' + this.name;
}
};
var func = _.bindKey(object, 'greet', 'hi');
equal(func(), 'hi: moe');
object.greet = function(greeting) {
return greeting + ' ' + this.name + '!';
};
equal(func(), 'hi moe!');
});
}());
/*--------------------------------------------------------------------------*/
QUnit.module('lodash.clone');
(function() {
@@ -1002,29 +1025,6 @@
/*--------------------------------------------------------------------------*/
QUnit.module('lodash.lateBind');
(function() {
test('should work when the target function is overwritten', function() {
var object = {
'name': 'moe',
'greet': function(greeting) {
return greeting + ': ' + this.name;
}
};
var func = _.lateBind(object, 'greet', 'hi');
equal(func(), 'hi: moe');
object.greet = function(greeting) {
return greeting + ' ' + this.name + '!';
};
equal(func(), 'hi moe!');
});
}());
/*--------------------------------------------------------------------------*/
QUnit.module('lodash.map');
(function() {