-
Notifications
You must be signed in to change notification settings - Fork 37
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Dane Springmeyer
committed
Aug 9, 2013
1 parent
b6eb41f
commit 489b651
Showing
4 changed files
with
68 additions
and
2 deletions.
There are no files selected for viewing
This file contains 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 characters
Binary file not shown.
This file contains 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 characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
var fs = require('fs'); | ||
var path = require('path'); | ||
var assert = require('assert'); | ||
|
||
// switch to 'development' for more verbose logging | ||
process.env.NODE_ENV = 'production' | ||
var utils = require('../lib/util.js'); | ||
var millstone = require('../lib/millstone'); | ||
var tests = module.exports = {}; | ||
var rm = require('./support.js').rm; | ||
|
||
var existsSync = require('fs').existsSync || require('path').existsSync; | ||
|
||
beforeEach(function(){ | ||
rm(path.join(__dirname, '/tmp/millstone-test')); | ||
}) | ||
|
||
// https://github.com/mapbox/millstone/issues/101 | ||
it('correctly prefers (for back compatibility) shapefiles over .txt files in zip archive', function(done) { | ||
var mml = JSON.parse(fs.readFileSync(path.join(__dirname, 'zip-with-shapefile-and-txt/project.mml'))); | ||
|
||
var cache = '/tmp/millstone-test'; | ||
var options = { | ||
mml: mml, | ||
base: path.join(__dirname, 'zip-with-shapefile-and-txt'), | ||
cache: cache | ||
}; | ||
|
||
try { | ||
fs.mkdirSync(options.cache, 0777); | ||
} catch (e) {} | ||
|
||
millstone.resolve(options, function(err, resolved) { | ||
assert.equal(err,undefined,err); | ||
assert.deepEqual(resolved.Layer[0].Datasource.type, 'shape'); | ||
done(); | ||
}); | ||
}); |
This file contains 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 characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
{ | ||
"Stylesheet": [ ], | ||
"Layer": [ | ||
{ | ||
"name": "zip-with-shapefile-and-txt", | ||
"Datasource": { | ||
"file": "../data/ne_10m_admin_0_boundary_lines_disputed_areas.zip" | ||
} | ||
} | ||
] | ||
} |