Skip to content

Commit

Permalink
executable option
Browse files Browse the repository at this point in the history
Added the executable option back so the Cucumber path can be modified for customized Cucumber.js modifications
  • Loading branch information
s9tpepper committed Apr 1, 2013
1 parent 0808584 commit e120151
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions tasks/cucumber-js-task.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
module.exports = function (grunt) {

var cucumber = require('cucumber');
var _ = grunt.util._;

// The Cucumber Task
grunt.registerMultiTask('cucumberjs', 'Runs cucumber.js', function () {
// Make this task async
Expand All @@ -14,7 +11,8 @@ module.exports = function (grunt) {
var steps = options.steps;
var tags = options.tags;
var format = options.format;

var executable = options.executable;

grunt.verbose.writeflags(options, 'Options');

var callback = function(succeeded) {
Expand Down Expand Up @@ -44,7 +42,8 @@ module.exports = function (grunt) {


var execOptions = ['node', 'node_modules/.bin/cucumber-js'];


var _ = grunt.util._;
if (! _.isEmpty(files)) {
execOptions = execOptions.concat(files);
}
Expand All @@ -63,8 +62,14 @@ module.exports = function (grunt) {
execOptions.push('-f');
execOptions.push(format);
}

var cucumberPath = 'cucumber';
if (! _.isEmpty(executable)) {
cucumberPath = executable;
}

grunt.verbose.writeln('Exec Options: ' + execOptions.join(' '));
var cucumber = require(cucumberPath);
cucumber.Cli(execOptions).run(callback);

});
Expand Down

0 comments on commit e120151

Please sign in to comment.