adjusted the 'do' action, so that it will replace $args within the body

This commit is contained in:
Spencer Alger
2014-03-03 08:32:43 -07:00
parent 29a0a0329e
commit 66a399d623

View File

@ -331,9 +331,32 @@ YamlDoc.prototype = {
paramName = camelName;
}
params[paramName] = (typeof val === 'string' && val[0] === '$') ? this.get(val) : val;
// for ercursively traversing the params to replace '$stashed' vars
var transformObject = function (vals, val, i) {
switch (typeof val) {
case 'string':
val = (val[0] === '$') ? this.get(val) : val;
break;
case 'object':
val = _.transform(val, transformObject);
}
vals[i] = val;
}.bind(this);
// start with the initial param, only traverse traversables
switch (typeof val) {
case 'string':
val = (val[0] === '$') ? this.get(val) : val;
break;
case 'object':
val = _.transform(val, transformObject);
break;
}
params[paramName] = val;
}, {}, this);
expect(clientAction || clientActionName).to.be.a('function');
if (typeof clientAction === 'function') {