-
-
Save tobie/4713821 to your computer and use it in GitHub Desktop.
Revisions
-
tobie revised this gist
Feb 5, 2013 . 1 changed file with 1 addition and 3 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,7 +1,5 @@ function load(fixtures) { return Q.all(fixtures.map(store)); } describe("moods tests", function() { -
DavidBruant revised this gist
Feb 5, 2013 . 1 changed file with 3 additions and 3 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -12,8 +12,8 @@ describe("moods tests", function() { , "2013-02-04:n1k0:rainy" // … we could add many more ]; // a promise-freindly test framework would expect promises to be returned it ("should do something useful with moods", function() { return load(moods); }); }); -
DavidBruant revised this gist
Feb 5, 2013 . 2 changed files with 2 additions and 5 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -19,9 +19,7 @@ describe("moods tests", function() { it ("should do something useful with moods", function(done) { load(moods, function(err, storedMoods) { done(err || undefined); // to make a fair comparison }); }); }); This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,7 +1,6 @@ function load(fixtures) { return Q.all(fixtures.map(function(fixture) { return store(fixture); // assumes the store function returns a promise for success }); } -
DavidBruant revised this gist
Feb 5, 2013 . No changes.There are no files selected for viewing
-
DavidBruant revised this gist
Feb 5, 2013 . 2 changed files with 27 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,27 @@ function load(fixtures, onComplete) { async.parallel(fixtures.map(function(fixture) { return function(cb) { store(fixture, function(err, result) { cb(err, result); }); }; }), onComplete); } describe("moods tests", function() { var moods = [ "2013-02-01:n1k0:sunny" , "2013-02-02:n1k0:cloudy" , "2013-02-03:n1k0:stormy" , "2013-02-04:n1k0:rainy" // … we could add many more ]; it ("should do something useful with moods", function(done) { load(moods, function(err, storedMoods) { assert.ifError(err); // now let's test stuff with stored moods done(); }); }); }); File renamed without changes. -
DavidBruant created this gist
Feb 5, 2013 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,20 @@ function load(fixtures) { return Q.all(fixtures.map(function(fixture) { // assumes the store function returns a promise for success return store(fixture) }); } describe("moods tests", function() { var moods = [ "2013-02-01:n1k0:sunny" , "2013-02-02:n1k0:cloudy" , "2013-02-03:n1k0:stormy" , "2013-02-04:n1k0:rainy" // … we could add many more ]; it ("should do something useful with moods", function(done) { load(moods).done(done); }); });