Fix broken tests due to missing sample data.

This commit is contained in:
Mike Bostock 2012-12-20 15:37:09 -08:00
Родитель 7a67b00b3e
Коммит abaa6f1645
11 изменённых файлов: 20 добавлений и 10 удалений

Просмотреть файл

@ -9,7 +9,7 @@ suite.addBatch({
"json": { "json": {
topic: function() { topic: function() {
var cb = this.callback; var cb = this.callback;
d3.json("examples/data/sample.json", function(error, json) { d3.json("test/data/sample.json", function(error, json) {
cb(null, json); cb(null, json);
}); });
}, },

Просмотреть файл

@ -9,7 +9,7 @@ suite.addBatch({
"text": { "text": {
topic: function() { topic: function() {
var cb = this.callback; var cb = this.callback;
d3.text("examples/data/sample.txt", function(error, text) { d3.text("test/data/sample.txt", function(error, text) {
cb(null, text); cb(null, text);
}); });
}, },
@ -22,7 +22,7 @@ suite.addBatch({
"": { "": {
topic: function() { topic: function() {
var cb = this.callback; var cb = this.callback;
d3.text("examples/data/sample.txt", "text/plain+sample", function(error, text) { d3.text("test/data/sample.txt", "text/plain+sample", function(error, text) {
cb(null, text); cb(null, text);
}); });
}, },

Просмотреть файл

@ -9,12 +9,12 @@ suite.addBatch({
"xhr": { "xhr": {
topic: function() { topic: function() {
var cb = this.callback; var cb = this.callback;
d3.xhr("examples/data/sample.txt", function(error, req) { d3.xhr("test/data/sample.txt", function(error, req) {
cb(null, req); cb(null, req);
}); });
}, },
"makes an asynchronous HTTP request": function(req) { "makes an asynchronous HTTP request": function(req) {
assert.equal(req._info.url, "examples/data/sample.txt"); assert.equal(req._info.url, "test/data/sample.txt");
assert.isTrue(req._info.async); assert.isTrue(req._info.async);
}, },
"invokes the callback with the request object": function(req) { "invokes the callback with the request object": function(req) {
@ -30,7 +30,7 @@ suite.addBatch({
"": { "": {
topic: function() { topic: function() {
var cb = this.callback; var cb = this.callback;
d3.xhr("examples/data/sample.txt", "text/plain", function(error, req) { d3.xhr("test/data/sample.txt", "text/plain", function(error, req) {
cb(null, req); cb(null, req);
}); });
}, },

Просмотреть файл

@ -9,7 +9,7 @@ suite.addBatch({
"xml": { "xml": {
topic: function() { topic: function() {
var cb = this.callback; var cb = this.callback;
d3.xml("examples/data/sample.xml", function(error, xml) { d3.xml("test/data/sample.xml", function(error, xml) {
cb(null, xml); cb(null, xml);
}); });
}, },
@ -22,7 +22,7 @@ suite.addBatch({
"": { "": {
topic: function() { topic: function() {
var cb = this.callback; var cb = this.callback;
d3.xml("examples/data/sample.txt", "application/xml+sample", function(error, xml) { d3.xml("test/data/sample.txt", "application/xml+sample", function(error, xml) {
cb(null, xml); cb(null, xml);
}); });
}, },

2
test/data/sample.csv Normal file
Просмотреть файл

@ -0,0 +1,2 @@
Hello,World
42,"""fish"""
1 Hello World
2 42 "fish"

1
test/data/sample.json Normal file
Просмотреть файл

@ -0,0 +1 @@
[{"Hello": 42, "World": "\"fish\""}]

2
test/data/sample.tsv Normal file
Просмотреть файл

@ -0,0 +1,2 @@
Hello World
42 """fish"""
1 Hello World
2 42 "fish"

1
test/data/sample.txt Normal file
Просмотреть файл

@ -0,0 +1 @@
Hello, world!

4
test/data/sample.xml Normal file
Просмотреть файл

@ -0,0 +1,4 @@
<?xml version="1.0" encoding="UTF-8" ?>
<hello>
<world name="Earth"/>
</hello>

Просмотреть файл

@ -9,7 +9,7 @@ suite.addBatch({
"csv": { "csv": {
topic: function() { topic: function() {
var cb = this.callback; var cb = this.callback;
d3.csv("examples/data/sample.csv", function(error, csv) { d3.csv("test/data/sample.csv", function(error, csv) {
cb(null, csv); cb(null, csv);
}); });
}, },

Просмотреть файл

@ -9,7 +9,7 @@ suite.addBatch({
"tsv": { "tsv": {
topic: function() { topic: function() {
var cb = this.callback; var cb = this.callback;
d3.tsv("examples/data/sample.tsv", function(error, tsv) { d3.tsv("test/data/sample.tsv", function(error, tsv) {
cb(null, tsv); cb(null, tsv);
}); });
}, },