[#162,be/csv][s]: add fetch method as per new #162 approach and support more methods than just file - string, local online CSV file.

* Also get to remove code obsoleted by recent work in #165 to allow fetch to return simple set of records (see penultimate commit)
This commit is contained in:
Rufus Pollock
2012-06-24 14:37:46 +01:00
parent 1e550e4437
commit 3837123eca
2 changed files with 52 additions and 56 deletions

View File

@@ -24,9 +24,15 @@ test("parseCSV", function() {
'"Jones, Jay", 10\n' +
'"Xyz ""ABC"" O\'Brien", 11:35\n' +
'"Other, AN", 12:35\n';
var dataset = recline.Backend.CSV.csvToDataset(csv);
dataset.query();
var dataset = new recline.Model.Dataset({
data: csv
},
'csv'
);
dataset.fetch();
equal(dataset.currentRecords.length, 3);
var row = dataset.currentRecords.models[0].toJSON();
deepEqual(row, {Name: 'Jones, Jay', Value: 10});
});
test("parseCSVsemicolon", function() {