mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-10 19:07:49 +00:00
Update vendors.
Former-commit-id: baf89d2c3bd7077462995bffa7f8bff1e1cf28f9
This commit is contained in:
28
vendor/backbone/test/events.js
vendored
28
vendor/backbone/test/events.js
vendored
@@ -86,30 +86,6 @@ $(document).ready(function() {
|
||||
b.trigger('change');
|
||||
});
|
||||
|
||||
test("listenTo with context", 1, function() {
|
||||
var a = _.extend({}, Backbone.Events);
|
||||
var ctx = {};
|
||||
a.listenTo(a, 'foo', function(){ equal(this, ctx); }, ctx);
|
||||
a.trigger('foo');
|
||||
});
|
||||
|
||||
test("stopListening with context", 2, function() {
|
||||
var a = _.extend({}, Backbone.Events);
|
||||
var ctx = {};
|
||||
var calledWithContext = false;
|
||||
var calledWithoutContext = false;
|
||||
|
||||
a.listenTo(a, 'foo', function(){ calledWithContext = true; }, ctx);
|
||||
a.listenTo(a, 'foo', function(){ calledWithoutContext = true; });
|
||||
|
||||
a.stopListening(a, 'foo', null, ctx);
|
||||
|
||||
a.trigger('foo');
|
||||
|
||||
equal(false, calledWithContext);
|
||||
equal(true, calledWithoutContext);
|
||||
});
|
||||
|
||||
test("trigger all for each event", 3, function() {
|
||||
var a, b, obj = { counter: 0 };
|
||||
_.extend(obj, Backbone.Events);
|
||||
@@ -384,4 +360,8 @@ $(document).ready(function() {
|
||||
Backbone.trigger('all');
|
||||
});
|
||||
|
||||
test("once without a callback is a noop", 0, function() {
|
||||
_.extend({}, Backbone.Events).once('event').trigger('event');
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user