ignore absolute paths in test

This commit is contained in:
Konstantin Käfer 2011-01-25 15:49:22 -05:00
parent 57eddba1ca
commit 21be74b487
2 changed files with 17 additions and 3 deletions

View File

@ -29,6 +29,8 @@ helper.files('rendering', 'mml', function(file) {
resultParser.addListener('end', function(resultXML) {
var messParser = new xml2js.Parser();
messParser.addListener('end', function(messXML) {
removeAbsoluteDatasources(messXML);
completed = true;
try {
assert.deepEqual(messXML, resultXML);
@ -52,3 +54,15 @@ helper.files('rendering', 'mml', function(file) {
});
}
});
function removeAbsoluteDatasources(xml) {
xml.Layer.forEach(function(layer) {
layer.Datasource.Parameter.forEach(function(param) {
if (param.attr.name === 'file') {
param.text = "[absolute path]";
}
});
});
}

View File

@ -41,7 +41,7 @@
<StyleName>world-line/__default__</StyleName>
<StyleName>world-polygon/__default__</StyleName>
<Datasource>
<Parameter name="file">false</Parameter>
<Parameter name="file">[absolute path]</Parameter>
<Parameter name="type">shape</Parameter>
</Datasource>
</Layer>
@ -76,7 +76,7 @@
<StyleName>countries-line/__default__</StyleName>
<StyleName>countries-polygon/__default__</StyleName>
<Datasource>
<Parameter name="file">false</Parameter>
<Parameter name="file">[absolute path]</Parameter>
<Parameter name="type">shape</Parameter>
</Datasource>
</Layer>