Skip to content

Commit

Permalink
Fix CLI arguments passing (close #83)
Browse files Browse the repository at this point in the history
Fixes mishandled process.argv when passed from Configuration to ArgumentParser. Instead of passing argv to parse() it should be passed in to ArgumentParser() per argument_parser_spec.js.
  • Loading branch information
s9tpepper authored and jbpros committed Aug 3, 2012
1 parent 6892ccf commit 84b8c06
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions lib/cucumber/cli/configuration.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
var Configuration = function(argv) {
var Cucumber = require('../../cucumber');

var argumentParser = Cucumber.Cli.ArgumentParser();
argumentParser.parse(argv);
var argumentParser = Cucumber.Cli.ArgumentParser(argv);
argumentParser.parse();

var self = {
getFormatter: function getFormatter() {
Expand Down
4 changes: 2 additions & 2 deletions spec/cucumber/cli/configuration_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,11 @@ describe("Cucumber.Cli.Configuration", function () {

describe("constructor", function () {
it("creates an argument parser", function () {
expect(Cucumber.Cli.ArgumentParser).toHaveBeenCalledWith();
expect(Cucumber.Cli.ArgumentParser).toHaveBeenCalledWith(argv);
});

it("tells the argument parser to parse the arguments", function () {
expect(argumentParser.parse).toHaveBeenCalledWith(argv);
expect(argumentParser.parse).toHaveBeenCalledWith();
});
});

Expand Down

0 comments on commit 84b8c06

Please sign in to comment.