From 40fbd6999a75db09c429e9a268f12912d0cb1c69 Mon Sep 17 00:00:00 2001 From: Benson Perry Date: Fri, 20 Sep 2013 16:26:59 -0400 Subject: [PATCH] fixes --- Gruntfile.js | 30 +++++++++++++++++++++++++----- README.md | 4 ++-- tasks/cucumber-js-task.js | 2 +- 3 files changed, 28 insertions(+), 8 deletions(-) diff --git a/Gruntfile.js b/Gruntfile.js index dafb8fc..f776236 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -9,10 +9,28 @@ module.exports = function (grunt) { } }, cucumberjs: { - files: 'features', - options: { - steps: 'features/step_definitions', - format: 'pretty' + test1: { + files: 'features', + options: { + steps: 'features/step_definitions', + format: 'pretty' + } + }, + test2: { + files: 'features', + options: { + steps: 'features/step_definitions', + format: 'pretty', + tags: '@tag' + } + }, + test3: { + files: 'features', + options: { + steps: 'features/step_definitions', + format: 'pretty', + tags: ['~@wip', '@tag'] + } } } }); @@ -21,5 +39,7 @@ module.exports = function (grunt) { grunt.loadTasks('tasks'); - grunt.registerTask('default', ['jshint', 'cucumberjs']); + grunt.registerTask('default', ['jshint', 'cucumberjs:test1']); + + grunt.registerTask('tag-tests', ['cucumberjs:test2', 'cucumberjs:test3']) }; diff --git a/README.md b/README.md index c0b0691..4c505ba 100644 --- a/README.md +++ b/README.md @@ -58,9 +58,9 @@ this represents boolean NOT. Example: by a comma, which represents logical OR. Example: `tags: '@dev,@wip'` -To represent a logcal AND, use an array. +To represent a logical AND, use an array. This is useful if you want to skip certain features -and run other specific (tagged) features. Example: +and run other specific features. Example: `tags: ['~@wip', '@dev']` #### format diff --git a/tasks/cucumber-js-task.js b/tasks/cucumber-js-task.js index 28ac904..d36e4c9 100644 --- a/tasks/cucumber-js-task.js +++ b/tasks/cucumber-js-task.js @@ -53,7 +53,7 @@ module.exports = function (grunt) { } if (! _.isEmpty(tags)) { - if (typeof tags == "string") { + if (typeof tags === "string") { tags = [tags]; } for (var i=0; i < tags.length; i++) {