From 087a038019bca2cc5af58248f446ce4eba945008 Mon Sep 17 00:00:00 2001 From: Julien Biezemans Date: Thu, 6 Mar 2014 11:20:09 +0100 Subject: [PATCH] Align snippet comment with Cucumber-Ruby/JVM (close #150) --- features/step_definitions/cucumber_js_mappings.rb | 2 +- .../support_code/step_definition_snippet_builder_syntax.js | 4 ++-- .../support_code/step_definition_snippet_builder_spec.js | 6 +++--- .../step_definition_snippet_builder_syntax_spec.js | 3 +-- 4 files changed, 7 insertions(+), 8 deletions(-) diff --git a/features/step_definitions/cucumber_js_mappings.rb b/features/step_definitions/cucumber_js_mappings.rb index a3e0db2ad..f53492dab 100644 --- a/features/step_definitions/cucumber_js_mappings.rb +++ b/features/step_definitions/cucumber_js_mappings.rb @@ -297,7 +297,7 @@ def assert_suggested_step_definition_snippet(stepdef_keyword, stepdef_pattern, p params = params.join ", " expected_snippet = <<-EOF this.#{stepdef_keyword}(/#{stepdef_pattern}/, function (#{params}) { - // express the regexp above with the code you wish you had + // Write code here that turns the phrase above into concrete actions callback.pending(); }); EOF diff --git a/lib/cucumber/support_code/step_definition_snippet_builder_syntax.js b/lib/cucumber/support_code/step_definition_snippet_builder_syntax.js index a9d120369..2cbc7de36 100644 --- a/lib/cucumber/support_code/step_definition_snippet_builder_syntax.js +++ b/lib/cucumber/support_code/step_definition_snippet_builder_syntax.js @@ -43,7 +43,7 @@ Syntax.prototype = { getQuotedStringMatchingGroup: function() { return '"([^"]*)"'; }, - + getOutlineExampleMatchingGroup: function() { return '(.*)'; }, @@ -53,7 +53,7 @@ Syntax.prototype = { }, getStepDefinitionEndComment: function() { - return 'express the regexp above with the code you wish you had'; + return 'Write code here that turns the phrase above into concrete actions'; } }; diff --git a/spec/cucumber/support_code/step_definition_snippet_builder_spec.js b/spec/cucumber/support_code/step_definition_snippet_builder_spec.js index d16cb0fec..922ee2ac7 100644 --- a/spec/cucumber/support_code/step_definition_snippet_builder_spec.js +++ b/spec/cucumber/support_code/step_definition_snippet_builder_spec.js @@ -12,7 +12,7 @@ describe("Cucumber.SupportCode.StepDefinitionSnippetBuilder", function() { getStepDefinitionStart : 'this.', getStepDefinitionInner1 : '(', getStepDefinitionInner2 : ', function(', - getStepDefinitionEnd : ") {\n // express the regexp above with the code you wish you had\n callback.pending();\n});\n", + getStepDefinitionEnd : ") {\n // Write code here that turns the phrase above into concrete actions\n callback.pending();\n});\n", getContextStepDefinitionFunctionName : 'Given', getEventStepDefinitionFunctionName : 'When', getOutcomeStepDefinitionFunctionName : 'Then', @@ -65,7 +65,7 @@ describe("Cucumber.SupportCode.StepDefinitionSnippetBuilder", function() { pattern + ", function(" + parameters + - ") {\n // express the regexp above with the code you wish you had\n callback.pending();\n});\n"; + ") {\n // Write code here that turns the phrase above into concrete actions\n callback.pending();\n});\n"; expect(actualSnippet).toBe(expectedSnippet); }); }); @@ -135,7 +135,7 @@ describe("Cucumber.SupportCode.StepDefinitionSnippetBuilder", function() { spyOnStub(step, 'getName').andReturn(stepName); spyOnStub(step, 'isOutlineStep'); spyOnStub(Cucumber.Util.RegExp, 'escapeString').andReturn(escapedStepName); - spyOn(snippetBuilder, 'parameterizeStepName').andReturn(parameterizedStepName); + spyOn(snippetBuilder, 'parameterizeStepName').andReturn(parameterizedStepName); }); it("gets the step name", function() { diff --git a/spec/cucumber/support_code/step_definition_snippet_builder_syntax_spec.js b/spec/cucumber/support_code/step_definition_snippet_builder_syntax_spec.js index d47604e7d..92af3beeb 100644 --- a/spec/cucumber/support_code/step_definition_snippet_builder_syntax_spec.js +++ b/spec/cucumber/support_code/step_definition_snippet_builder_syntax_spec.js @@ -3,7 +3,7 @@ require('../../support/spec_helper'); describe('Cucumber.SupportCode.StepDefinitionSnippetBuilderSyntax', function () { var Cucumber = requireLib('cucumber'); var Syntax = Cucumber.SupportCode.StepDefinitionSnippetBuilderSyntax; - var stepDefinitionEndComment = 'express the regexp above with the code you wish you had'; + var stepDefinitionEndComment = 'Write code here that turns the phrase above into concrete actions'; function testBaseSyntax(syntax) { @@ -143,4 +143,3 @@ describe('Cucumber.SupportCode.StepDefinitionSnippetBuilderSyntax', function () }); }); }); -