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) { resultParser.addListener('end', function(resultXML) {
var messParser = new xml2js.Parser(); var messParser = new xml2js.Parser();
messParser.addListener('end', function(messXML) { messParser.addListener('end', function(messXML) {
removeAbsoluteDatasources(messXML);
completed = true; completed = true;
try { try {
assert.deepEqual(messXML, resultXML); 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-line/__default__</StyleName>
<StyleName>world-polygon/__default__</StyleName> <StyleName>world-polygon/__default__</StyleName>
<Datasource> <Datasource>
<Parameter name="file">false</Parameter> <Parameter name="file">[absolute path]</Parameter>
<Parameter name="type">shape</Parameter> <Parameter name="type">shape</Parameter>
</Datasource> </Datasource>
</Layer> </Layer>
@ -76,7 +76,7 @@
<StyleName>countries-line/__default__</StyleName> <StyleName>countries-line/__default__</StyleName>
<StyleName>countries-polygon/__default__</StyleName> <StyleName>countries-polygon/__default__</StyleName>
<Datasource> <Datasource>
<Parameter name="file">false</Parameter> <Parameter name="file">[absolute path]</Parameter>
<Parameter name="type">shape</Parameter> <Parameter name="type">shape</Parameter>
</Datasource> </Datasource>
</Layer> </Layer>