From e12cb5302fb179fd01feec74f09c570c26eef58e Mon Sep 17 00:00:00 2001 From: Omar Gonzalez Date: Thu, 9 Aug 2012 12:07:59 -0700 Subject: [PATCH] v.0.1.1 -Added a configuration option to change the path to the Cucumber.js library, enabling control over the path lets developers use customized versions of Cucumber.js -Updated version number to 0.1.1 -Updated README with new config option Signed-off-by: Omar Gonzalez --- README.md | 1 + grunt.js | 1 + package.json | 2 +- tasks/cucumber-js-task.js | 3 ++- 4 files changed, 5 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index ad569a4..e2273ee 100644 --- a/README.md +++ b/README.md @@ -10,6 +10,7 @@ Then add this line to your project's `grunt.js` gruntfile: ```javascript grunt.initConfig({ cucumberjs: { + executable: "../path/to/custom/cucumberjs", features: "path/to/features", steps: "path/to/step_definitions", tags: "@dev" diff --git a/grunt.js b/grunt.js index decabb7..d09460d 100644 --- a/grunt.js +++ b/grunt.js @@ -23,6 +23,7 @@ module.exports = function (grunt) { globals: {} }, cucumberjs: { + executable: "../node_modules/cucumber/lib/cucumber.js", /* Relative to /tasks folder */ features: "features", steps: "features/step_definitions" } diff --git a/package.json b/package.json index a8aa63c..cfba9c4 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name" : "grunt-cucumber", "description" : "Grunt task for running Cucumber.js", - "version" : "0.1.0", + "version" : "0.1.1", "homepage" : "https://github.com/s9tpepper/grunt-cucumber-js", "author" : { "name" : "Omar Gonzalez", diff --git a/tasks/cucumber-js-task.js b/tasks/cucumber-js-task.js index ff413fa..fa0ac0b 100644 --- a/tasks/cucumber-js-task.js +++ b/tasks/cucumber-js-task.js @@ -2,7 +2,8 @@ module.exports = function (grunt) { grunt.registerTask("cucumberjs", "Runs cucumber.js", function () { - var Cucumber = require('cucumber'); + var cucumberPath = grunt.config("cucumberjs.executable") || 'cucumber'; + var Cucumber = require(cucumberPath); var features = grunt.config("cucumberjs.features") || 'features'; var steps = grunt.config("cucumberjs.steps") || 'features/step_definitions';