Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

added dependency to underscore.string, changed snippet builder to cam…

…elize outline variables when put into arguments list
  • Loading branch information...
commit e7e2198875f817107df1ed44b3ebb1678b5fb77a 1 parent 66b9f7d
@vantreeseba vantreeseba authored
View
6 lib/cucumber/support_code/step_definition_snippet_builder.js
@@ -1,9 +1,11 @@
-var _ = require('underscore'),
+var _ = require('underscore'),
stepDefinitionSnippetBuilderSyntax = require ('./step_definition_snippet_builder_syntax');
+ _.str = require('underscore.string');
var StepDefinitionSnippetBuilder = function(step, syntax) {
var Cucumber = require('../../cucumber');
+
var self = {
buildSnippet: function buildSnippet() {
var functionName = self.buildStepDefinitionFunctionName();
@@ -67,7 +69,7 @@ var StepDefinitionSnippetBuilder = function(step, syntax) {
var stepName = step.isOutlineStep() ? step.getOriginalStep().getName() : step.getName();
var outlineParams = stepName.match(StepDefinitionSnippetBuilder.OUTLINE_STRING_PATTERN);
function cleanParam(param){
- return param.substr(1,param.length - 2);
+ return _.str.camelize(param.substr(1,param.length - 2));
}
var cleaned = _.map(outlineParams, cleanParam);
View
1  package.json
@@ -57,6 +57,7 @@
"browserify": "1.15.5",
"nopt": "2.1.2",
"underscore": "1.5.2",
+ "underscore.string" : "2.3.3",
"cucumber-html": "0.2.3",
"walkdir": "0.0.7",
"coffee-script": "1.6.3",
Please sign in to comment.
Something went wrong with that request. Please try again.