[Pkg-javascript-commits] [backbone] 33/101: linting test/bindable

Jonas Smedegaard js at moszumanska.debian.org
Sat May 3 16:58:26 UTC 2014


This is an automated email from the git hooks/post-receive script.

js pushed a commit to tag 0.1.0
in repository backbone.

commit 03c1c70f3fbd8d0f2b5bc5befa299d60733db2da
Author: Jeremy Ashkenas <jashkenas at gmail.com>
Date:   Wed Oct 6 11:33:31 2010 -0400

    linting test/bindable
---
 test/bindable.js | 48 ++++++++++++++++++++++++------------------------
 1 file changed, 24 insertions(+), 24 deletions(-)

diff --git a/test/bindable.js b/test/bindable.js
index 465a676..5f8b79a 100644
--- a/test/bindable.js
+++ b/test/bindable.js
@@ -3,40 +3,40 @@ $(document).ready(function() {
   module("Backbone bindable");
 
     test("bindable: bind and trigger", function() {
-        var obj = { counter: 0 }
+        var obj = { counter: 0 };
         _.extend(obj,Backbone.Bindable);
-        obj.bind('foo',function() { obj.counter += 1; });
-        obj.trigger('foo');
+        obj.bind('event', function() { obj.counter += 1; });
+        obj.trigger('event');
         equals(obj.counter,1,'counter should be incremented.');
-        obj.trigger('foo');
-        obj.trigger('foo');
-        obj.trigger('foo');
-        obj.trigger('foo');
-        equals(obj.counter,5,'counter should be incremented five times.');
+        obj.trigger('event');
+        obj.trigger('event');
+        obj.trigger('event');
+        obj.trigger('event');
+        equals(obj.counter, 5, 'counter should be incremented five times.');
     });
-  
+
     test("bindable: bind, then unbind all functions", function() {
-        var obj = { counter: 0 }
+        var obj = { counter: 0 };
         _.extend(obj,Backbone.Bindable);
-        var callback = function() { obj.counter += 1; }
-        obj.bind('foo', callback);
-        obj.trigger('foo');
-        obj.unbind('foo');
-        obj.trigger('foo');
-        equals(obj.counter,1,'counter should have only been incremented once.')
+        var callback = function() { obj.counter += 1; };
+        obj.bind('event', callback);
+        obj.trigger('event');
+        obj.unbind('event');
+        obj.trigger('event');
+        equals(obj.counter, 1, 'counter should have only been incremented once.');
     });
 
     test("bindable: bind two callbacks, unbind only one", function() {
-        var obj = { counterA: 0, counterB: 0 }
+        var obj = { counterA: 0, counterB: 0 };
         _.extend(obj,Backbone.Bindable);
         var callback = function() { obj.counterA += 1; };
-        obj.bind('foo', callback);
-        obj.bind('foo', function() { obj.counterB += 1 });
-        obj.trigger('foo');
-        obj.unbind('foo', callback);
-        obj.trigger('foo');
-        equals(obj.counterA,1,'counterA should have only been incremented once.')
-        equals(obj.counterB,2,'counterB should have been incremented twice.')
+        obj.bind('event', callback);
+        obj.bind('event', function() { obj.counterB += 1; });
+        obj.trigger('event');
+        obj.unbind('event', callback);
+        obj.trigger('event');
+        equals(obj.counterA, 1, 'counterA should have only been incremented once.');
+        equals(obj.counterB, 2, 'counterB should have been incremented twice.');
     });
 
 });
\ No newline at end of file

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-javascript/backbone.git



More information about the Pkg-javascript-commits mailing list