[Pkg-javascript-commits] [backbone] 34/101: linting the remainder of the tests.

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 71969d367b916465df4566ba1bd76fb76c959840
Author: Jeremy Ashkenas <jashkenas at gmail.com>
Date:   Wed Oct 6 11:35:14 2010 -0400

    linting the remainder of the tests.
---
 test/collection.js |  6 +++---
 test/model.js      | 33 ++++++++++++++++-----------------
 2 files changed, 19 insertions(+), 20 deletions(-)

diff --git a/test/collection.js b/test/collection.js
index bc97695..ccb9159 100644
--- a/test/collection.js
+++ b/test/collection.js
@@ -8,12 +8,12 @@ $(document).ready(function() {
     c = new Backbone.Model({label: 'c'});
     d = new Backbone.Model({label: 'd'});
     col = new Backbone.Collection([a,b,c,d]);
-    equals(col.first(),a, "a should be first");
-    equals(col.last(),d, "d should be last");
+    equals(col.first(), a, "a should be first");
+    equals(col.last(), d, "d should be last");
   });
 
   test("collections: sorted", function() {
-      
+
   });
 
 });
\ No newline at end of file
diff --git a/test/model.js b/test/model.js
index 2804a5c..eb76612 100644
--- a/test/model.js
+++ b/test/model.js
@@ -6,23 +6,22 @@ $(document).ready(function() {
       attrs = { 'foo': 1, 'bar': 2, 'baz': 3};
       a = new Backbone.Model(attrs);
       b = a.clone();
-      equals(a.get('foo'),1);
-      equals(a.get('bar'),2);
-      equals(a.get('baz'),3);
-      equals(b.get('foo'),a.get('foo'),"Foo should be the same on the clone.");
-      equals(b.get('bar'),a.get('bar'),"Bar should be the same on the clone.");
-      equals(b.get('baz'),a.get('baz'),"Baz should be the same on the clone.");
+      equals(a.get('foo'), 1);
+      equals(a.get('bar'), 2);
+      equals(a.get('baz'), 3);
+      equals(b.get('foo'), a.get('foo'), "Foo should be the same on the clone.");
+      equals(b.get('bar'), a.get('bar'), "Bar should be the same on the clone.");
+      equals(b.get('baz'), a.get('baz'), "Baz should be the same on the clone.");
   });
 
   test("model: isEqual", function() {
       attrs = { 'foo': 1, 'bar': 2, 'baz': 3};
       a = new Backbone.Model(attrs);
       b = new Backbone.Model(attrs);
-      ok(a.isEqual(b),"a should equal b");
+      ok(a.isEqual(b), "a should equal b");
       c = new Backbone.Model({ 'foo': 1, 'bar': 2, 'baz': 3, 'qux': 4});
-      ok(!a.isEqual(c),"a should not equal c");
-      
-  })
+      ok(!a.isEqual(c), "a should not equal c");
+  });
 
   test("model: isNew", function() {
       attrs = { 'foo': 1, 'bar': 2, 'baz': 3};
@@ -30,24 +29,24 @@ $(document).ready(function() {
       ok(a.isNew(), "it should be new");
       attrs = { 'foo': 1, 'bar': 2, 'baz': 3, 'id': -5 };
       ok(a.isNew(), "any defined ID is legal, negative or positive");
-  })
+  });
 
   test("model: set", function() {
       attrs = { 'foo': 1, 'bar': 2, 'baz': 3};
       a = new Backbone.Model(attrs);
       var changeCount = 0;
-      a.bind("change", function() { changeCount += 1});
+      a.bind("change", function() { changeCount += 1; });
       a.set({'foo': 2});
-      ok(a.get('foo')==2, "Foo should have changed.");
+      ok(a.get('foo')== 2, "Foo should have changed.");
       ok(changeCount == 1, "Change count should have incremented.");
       a.set({'foo': 2}); // set with value that is not new shouldn't fire change event
-      ok(a.get('foo')==2, "Foo should NOT have changed, still 2");
+      ok(a.get('foo')== 2, "Foo should NOT have changed, still 2");
       ok(changeCount == 1, "Change count should NOT have incremented.");
-      
+
       a.unset('foo');
-      ok(a.get('foo')==null, "Foo should have changed");
+      ok(a.get('foo')== null, "Foo should have changed");
       ok(changeCount == 2, "Change count should have incremented for unset.");
-     
+
   });
 
 });
\ 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