# HG changeset patch # User Atul Varma # Date 1239816217 25200 # Node ID 5e1e88d1c3f57de997877e0ed926b3e628279406 # Parent 71df4d77dbf67f47736f888e31b6affcb8376cb4 Slight refactoring of test suite to make them more readable. diff -r 71df4d77dbf6 -r 5e1e88d1c3f5 js/tests.js --- a/js/tests.js Wed Apr 15 10:09:14 2009 -0700 +++ b/js/tests.js Wed Apr 15 10:23:37 2009 -0700 @@ -119,16 +119,14 @@ self.assertEqual(dict.has('foo'), true); }, _setupTestDb: function(cb) { + var documents = this._testDbContents; BrowserCouch.get( "blarg", function(db) { db.wipe( function() { db.put( - [{id: "monkey", - content: "hello there dude"}, - {id: "chunky", - content: "hello there dogen"}], + documents, function() { ModuleLoader.require( "JSON", @@ -141,6 +139,10 @@ new FakeStorage() ); }, + _testDbContents: [{id: "monkey", + content: "hello there dude"}, + {id: "chunky", + content: "hello there dogen"}], _mapWordFrequencies: function(doc, emit) { var words = doc.content.split(" "); for (var i = 0; i < words.length; i++)