From 26ca9c3969eeb7c9e0d149c1c837191ecb5969ec Mon Sep 17 00:00:00 2001 From: Tobie Langel Date: Mon, 8 Sep 2008 00:48:24 -0700 Subject: [PATCH] Add missing var declarations in unit tests. --- test/lib/unittest.js | 2 +- test/unit/dom_test.js | 3 +-- test/unit/form_test.js | 2 +- test/unit/string_test.js | 4 ++-- 4 files changed, 5 insertions(+), 6 deletions(-) diff --git a/test/lib/unittest.js b/test/lib/unittest.js index afe7eeb..e832eff 100644 --- a/test/lib/unittest.js +++ b/test/lib/unittest.js @@ -452,7 +452,7 @@ Test.Unit.Assertions = { }, assertElementsMatch: function() { - var pass = true, expressions = $A(arguments), elements = $A(expressions.shift()); + var message, pass = true, expressions = $A(arguments), elements = $A(expressions.shift()); if (elements.length != expressions.length) { message = this.buildMessage('assertElementsMatch', 'size mismatch: ? elements, ? expressions (?).', elements.length, expressions.length, expressions); this.flunk(message); diff --git a/test/unit/dom_test.js b/test/unit/dom_test.js index b128656..00d695c 100644 --- a/test/unit/dom_test.js +++ b/test/unit/dom_test.js @@ -195,8 +195,7 @@ new Test.Unit.Runner({ }, testNewElementInsert: function() { - var container = new Element('div'); - element = new Element('div'); + var container = new Element('div'), element = new Element('div'); container.insert(element); element.insert({ before: '

a paragraph

' }); diff --git a/test/unit/form_test.js b/test/unit/form_test.js index 1c12373..6773d5d 100644 --- a/test/unit/form_test.js +++ b/test/unit/form_test.js @@ -299,7 +299,7 @@ new Test.Unit.Runner({ }, testFormRequest: function() { - request = $("form").request(); + var request = $("form").request(); this.assert($("form").hasAttribute("method")); this.assert(request.url.include("fixtures/empty.js?val1=4")); this.assertEqual("get", request.method); diff --git a/test/unit/string_test.js b/test/unit/string_test.js index 9d4deea..ab20366 100644 --- a/test/unit/string_test.js +++ b/test/unit/string_test.js @@ -275,8 +275,8 @@ new Test.Unit.Runner({ }, testTemplateEvaluationWithFalses: function() { - var source = '#{zero}#{false_}#{undef}#{null_}#{empty}'; - var falses = {zero:0, false_:false, undef:undefined, null_:null, empty:""}; + var source = '#{zero}#{_false}#{undef}#{_null}#{empty}'; + var falses = {zero:0, _false:false, undef:undefined, _null:null, empty:""}; var template = new Template(source); this.assertEqual('0false',