updated grunt-run, tests now support skip.features and match:/regex/

This commit is contained in:
Spencer Alger
2014-02-03 09:55:45 -07:00
parent 88b86817a4
commit f7f98572a3
3 changed files with 16 additions and 5 deletions

View File

@ -42,7 +42,7 @@
"load-grunt-tasks": "~0.2.0",
"load-grunt-config": "~0.7.0",
"grunt-s3": "~0.2.0-alpha.3",
"grunt-run": "~0.1.12",
"grunt-run": "*",
"relative-fs": "0.0.1",
"grunt-contrib-compress": "~0.5.3",
"grunt-contrib-copy": "~0.4.1",

View File

@ -260,6 +260,9 @@ YamlDoc.prototype = {
* @param done
*/
do_skip: function (args, done) {
if (!args.version) {
return done();
}
rangeMatchesCurrentVersion(args.version, _.bind(function (match) {
if (match) {
if (this.description === 'setup') {
@ -416,10 +419,18 @@ YamlDoc.prototype = {
*/
do_match: function (args) {
_.forOwn(args, function (val, path) {
if (val[0] === '$') {
val = this.get(val);
var isRef = _.isString(val) && val[0] === '$';
var isRE = _.isString(val) && val[0] === '/' && path[path.length - 1] === '/';
if (isRef) {
val = this.get(val === '$body' ? '' : val);
} else if (isRE) {
val = new RegExp(val);
} else {
val = this.get(path);
}
expect(this.get(path)).to.eql(val, 'path: ' + path);
var assert = expect(val).to[isRE ? 'match' : 'eql'](val, 'path: ' + path);
}, this);
},