Skip to content

Commit 84b8c06

Browse files
s9tpepperjbpros
authored andcommitted
Fix CLI arguments passing (close #83)
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.
1 parent 6892ccf commit 84b8c06

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

lib/cucumber/cli/configuration.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
var Configuration = function(argv) {
22
var Cucumber = require('../../cucumber');
33

4-
var argumentParser = Cucumber.Cli.ArgumentParser();
5-
argumentParser.parse(argv);
4+
var argumentParser = Cucumber.Cli.ArgumentParser(argv);
5+
argumentParser.parse();
66

77
var self = {
88
getFormatter: function getFormatter() {

spec/cucumber/cli/configuration_spec.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,11 @@ describe("Cucumber.Cli.Configuration", function () {
2020

2121
describe("constructor", function () {
2222
it("creates an argument parser", function () {
23-
expect(Cucumber.Cli.ArgumentParser).toHaveBeenCalledWith();
23+
expect(Cucumber.Cli.ArgumentParser).toHaveBeenCalledWith(argv);
2424
});
2525

2626
it("tells the argument parser to parse the arguments", function () {
27-
expect(argumentParser.parse).toHaveBeenCalledWith(argv);
27+
expect(argumentParser.parse).toHaveBeenCalledWith();
2828
});
2929
});
3030

0 commit comments

Comments
 (0)