Sha256: 6102cab6b8a7002061f65089d01114d229337289733ac1002ccd232833949b92
Contents?: true
Size: 1.25 KB
Versions: 31
Compression:
Stored size: 1.25 KB
Contents
require("../env"); require("../../d3"); var vows = require("vows"), assert = require("assert"); var suite = vows.describe("d3.text"); suite.addBatch({ "text": { topic: function() { var cb = this.callback; return d3.text("examples/data/sample.txt", function(text) { cb(null, text); }); }, "invokes the callback with the loaded text": function(text) { assert.equal(text, "Hello, world!\n"); }, "does not override the mime type by default": function(text) { assert.isUndefined(XMLHttpRequest._last._info.mimeType); }, "": { topic: function() { var cb = this.callback; return d3.text("examples/data/sample.txt", "text/plain+sample", function(text) { cb(null, text); }); }, "observes the optional mime type": function(text) { assert.equal(XMLHttpRequest._last._info.mimeType, "text/plain+sample"); } }, " ": { topic: function() { var cb = this.callback; return d3.text("//does/not/exist.txt", function(text) { cb(null, text); }); }, "invokes the callback with null when an error occurs": function(text) { assert.isNull(text); } } } }); suite.export(module);
Version data entries
31 entries across 31 versions & 2 rubygems