Sha256: 7f3feccfe05e0a3ca871b943b7bffc9cde06332e4aee1d6d2c2a128b61e90c14

Contents?: true

Size: 947 Bytes

Versions: 31

Compression:

Stored size: 947 Bytes

Contents

require("../env");
require("../../d3");
require("../../d3.csv");

var vows = require("vows"),
    assert = require("assert");

var suite = vows.describe("d3.csv");

suite.addBatch({
  "csv": {
    topic: function() {
      var cb = this.callback;
      return d3.csv("examples/data/sample.csv", function(csv) {
        cb(null, csv);
      });
    },
    "invokes the callback with the parsed CSV": function(csv) {
      assert.deepEqual(csv, [{"Hello":42,"World":"\"fish\""}]);
    },
    "overrides the mime type to text/csv": function(csv) {
      assert.equal(XMLHttpRequest._last._info.mimeType, "text/csv");
    },
    "": {
      topic: function() {
        var cb = this.callback;
        return d3.csv("//does/not/exist.csv", function(csv) {
          cb(null, csv);
        });
      },
      "invokes the callback with null when an error occurs": function(csv) {
        assert.isNull(csv);
      }
    }
  }
});

suite.export(module);

Version data entries

31 entries across 31 versions & 2 rubygems

Version Path
picky-statistics-4.5.0 lib/picky-statistics/application/javascripts/d3/test/csv/csv-test.js
picky-statistics-4.4.2 lib/picky-statistics/application/javascripts/d3/test/csv/csv-test.js
picky-statistics-4.4.1 lib/picky-statistics/application/javascripts/d3/test/csv/csv-test.js
picky-statistics-4.4.0 lib/picky-statistics/application/javascripts/d3/test/csv/csv-test.js
picky-statistics-4.3.2 lib/picky-statistics/application/javascripts/d3/test/csv/csv-test.js
picky-statistics-4.3.1 lib/picky-statistics/application/javascripts/d3/test/csv/csv-test.js
picky-statistics-4.3.0 lib/picky-statistics/application/javascripts/d3/test/csv/csv-test.js
picky-statistics-4.2.4 lib/picky-statistics/application/javascripts/d3/test/csv/csv-test.js
picky-statistics-4.2.3 lib/picky-statistics/application/javascripts/d3/test/csv/csv-test.js
picky-statistics-4.2.2 lib/picky-statistics/application/javascripts/d3/test/csv/csv-test.js
picky-statistics-4.2.1 lib/picky-statistics/application/javascripts/d3/test/csv/csv-test.js
picky-statistics-4.2.0 lib/picky-statistics/application/javascripts/d3/test/csv/csv-test.js
picky-statistics-4.1.0 lib/picky-statistics/application/javascripts/d3/test/csv/csv-test.js
picky-statistics-4.0.9 lib/picky-statistics/application/javascripts/d3/test/csv/csv-test.js
picky-statistics-4.0.8 lib/picky-statistics/application/javascripts/d3/test/csv/csv-test.js
picky-statistics-4.0.7 lib/picky-statistics/application/javascripts/d3/test/csv/csv-test.js
picky-statistics-4.0.6 lib/picky-statistics/application/javascripts/d3/test/csv/csv-test.js
picky-statistics-4.0.5 lib/picky-statistics/application/javascripts/d3/test/csv/csv-test.js
picky-statistics-4.0.4 lib/picky-statistics/application/javascripts/d3/test/csv/csv-test.js
picky-statistics-4.0.3 lib/picky-statistics/application/javascripts/d3/test/csv/csv-test.js