Skip to content

Issue79 #116

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Merged
merged 2 commits into from
Sep 17, 2016
Merged

Issue79 #116

merged 2 commits into from
Sep 17, 2016

Conversation

konserw
Copy link
Contributor

@konserw konserw commented Jul 18, 2016

Fix for issue #79 - Suggested step definition when step sentence contains double quote

@konserw
Copy link
Contributor Author

konserw commented Jul 18, 2016

Any idea what happend on OSX?

@MartinDelille
Copy link
Contributor

I have the same result.

@konserw
Copy link
Contributor Author

konserw commented Jul 19, 2016

could you recheck?

@MartinDelille
Copy link
Contributor

Still failing:

./travis.sh
Successfully installed bundler-1.12.5
Parsing documentation for bundler-1.12.5
Done installing documentation for bundler after 3 seconds
1 gem installed
Ignoring eventmachine-1.0.9.1 because its extensions are not built.  Try: gem pristine eventmachine --version 1.0.9.1
Ignoring fast-stemmer-1.0.2 because its extensions are not built.  Try: gem pristine fast-stemmer --version 1.0.2
Ignoring gherkin-2.12.2 because its extensions are not built.  Try: gem pristine gherkin --version 2.12.2
Ignoring http_parser.rb-0.6.0 because its extensions are not built.  Try: gem pristine http_parser.rb --version 0.6.0
Ignoring jazzy-0.6.0 because its extensions are not built.  Try: gem pristine jazzy --version 0.6.0
Using ffi 1.9.13
Using contracts 0.14.0
Using builder 3.2.2
Using multi_json 1.12.0
Using diff-lcs 1.2.5
Using multi_test 0.1.2
Using rspec-support 3.4.1
Using bundler 1.12.5
Using childprocess 0.5.9
Using gherkin 2.12.2
Using rspec-expectations 3.4.0
Using rspec-core 3.4.4
Using rspec-mocks 3.4.1
Using cucumber-core 1.1.3
Using rspec 3.4.0
Using cucumber 2.0.0
Using aruba 0.8.0
Bundle complete! 3 Gemfile dependencies, 17 gems now installed.
Use `bundle show [gemname]` to see where a bundled gem is installed.
-- Boost version: 1.60.0
-- Found the following Boost libraries:
--   thread
--   system
--   regex
--   date_time
--   program_options
--   unit_test_framework
--   chrono
--   atomic
-- Could NOT find CPPSPEC (missing:  CPPSPEC_LIBRARY CPPSPEC_INCLUDE_DIR)
-- Downloading GMock / GTest version 1.7.0
-- Adding ContextHandlingTest
-- Adding HookRegistrationTest
-- Adding StepRegistrationTest
-- Adding TaggedHookRegistrationTest
-- Adding WireServerTest
-- Adding WireProtocolTest
-- Adding BasicStepTest
-- Adding ContextManagerTest
-- Adding CukeCommandsTest
-- Adding RegexTest
-- Adding StepCallChainTest
-- Adding StepManagerTest
-- Adding TableTest
-- Adding TagTest
-- Adding GTestDriverTest
-- Adding BoostDriverTest
-- Adding GenericDriverTest
-- Found Cucumber
-- Found unsuitable Qt version "" from NOTFOUND
-- Configuring done
-- Generating done
-- Build files have been written to: /Users/martin/dev/demo/cucumber-cpp/build
[  9%] Built target gmock
[ 30%] Built target cucumber-cpp
[ 50%] Built target cucumber-cpp-nomain
[ 52%] Built target BoostDriverTest
[ 54%] Built target GTestDriverTest
[ 56%] Built target TableTest
[ 59%] Built target WireProtocolTest
[ 61%] Built target HookRegistrationTest
[ 63%] Built target RegexTest
[ 66%] Built target CukeCommandsTest
[ 68%] Built target GenericDriverTest
[ 70%] Built target TagTest
[ 73%] Built target StepManagerTest
[ 75%] Built target ContextManagerTest
[ 77%] Built target WireServerTest
[ 80%] Built target StepCallChainTest
[ 82%] Built target StepRegistrationTest
[ 84%] Built target BasicStepTest
[ 87%] Built target TaggedHookRegistrationTest
[ 89%] Built target ContextHandlingTest
[ 91%] Built target Calc
[ 94%] Built target BoostCalculatorSteps
[ 96%] Built target GTestCalculatorSteps
[100%] Built target FeatureShowcaseSteps
Running tests...
Test project /Users/martin/dev/demo/cucumber-cpp/build
      Start  1: ContextHandlingTest.contextsAreCreatedWhenNeeded
 1/88 Test  #1: ContextHandlingTest.contextsAreCreatedWhenNeeded .................................   Passed    0.01 sec
      Start  2: ContextHandlingTest.sameContextTypesShareTheSamePointer
 2/88 Test  #2: ContextHandlingTest.sameContextTypesShareTheSamePointer ..........................   Passed    0.01 sec
      Start  3: ContextHandlingTest.theSameContextIsNotCreatedTwice
 3/88 Test  #3: ContextHandlingTest.theSameContextIsNotCreatedTwice ..............................   Passed    0.01 sec
      Start  4: ContextHandlingTest.contextsArePurgedExplicitlyOnly
 4/88 Test  #4: ContextHandlingTest.contextsArePurgedExplicitlyOnly ..............................   Passed    0.00 sec
      Start  5: HookRegistrationTest.hooksAreRegisteredByTheMacros
 5/88 Test  #5: HookRegistrationTest.hooksAreRegisteredByTheMacros ...............................   Passed    0.01 sec
      Start  6: HookRegistrationTest.beforeHooksAreInvokedInAnyOrder
 6/88 Test  #6: HookRegistrationTest.beforeHooksAreInvokedInAnyOrder .............................   Passed    0.01 sec
      Start  7: HookRegistrationTest.aroundStepHooksAreInvokedInAnyOrderButNested
 7/88 Test  #7: HookRegistrationTest.aroundStepHooksAreInvokedInAnyOrderButNested ................   Passed    0.01 sec
      Start  8: HookRegistrationTest.afterStepHooksAreInvokedInAnyOrder
 8/88 Test  #8: HookRegistrationTest.afterStepHooksAreInvokedInAnyOrder ..........................   Passed    0.01 sec
      Start  9: HookRegistrationTest.afterHooksAreInvokedInAnyOrder
 9/88 Test  #9: HookRegistrationTest.afterHooksAreInvokedInAnyOrder ..............................   Passed    0.00 sec
      Start 10: HookRegistrationTest.contextIsAccessibleInAfterHooks
10/88 Test #10: HookRegistrationTest.contextIsAccessibleInAfterHooks .............................   Passed    0.00 sec
      Start 11: HookRegistrationTest.afterStepHooksAreInvokedAfterAroundStepHooks
11/88 Test #11: HookRegistrationTest.afterStepHooksAreInvokedAfterAroundStepHooks ................   Passed    0.01 sec
      Start 12: HookRegistrationTest.beforeAllHooksAreInvokedInAnyOrderDuringFirstScenarioOnly
12/88 Test #12: HookRegistrationTest.beforeAllHooksAreInvokedInAnyOrderDuringFirstScenarioOnly ...   Passed    0.00 sec
      Start 13: HookRegistrationTest.beforeAllHooksAreNotInvokedIfNoScenariosRun
13/88 Test #13: HookRegistrationTest.beforeAllHooksAreNotInvokedIfNoScenariosRun .................   Passed    0.01 sec
      Start 14: HookRegistrationTest.afterAllHooksAreNotInvokedIfNoScenariosRun
14/88 Test #14: HookRegistrationTest.afterAllHooksAreNotInvokedIfNoScenariosRun ..................   Passed    0.00 sec
      Start 15: HookRegistrationTest.afterAllHooksAreInvokedOnceDuringDestructionOnly
15/88 Test #15: HookRegistrationTest.afterAllHooksAreInvokedOnceDuringDestructionOnly ............   Passed    0.01 sec
      Start 16: StepRegistrationTest.manualRegistration
16/88 Test #16: StepRegistrationTest.manualRegistration ..........................................   Passed    0.01 sec
      Start 17: StepRegistrationTest.macroRegistration
17/88 Test #17: StepRegistrationTest.macroRegistration ...........................................   Passed    0.00 sec
      Start 18: HookRegistrationTest.noTaggedHooksAreInvokedIfNoScenarioTag
18/88 Test #18: HookRegistrationTest.noTaggedHooksAreInvokedIfNoScenarioTag ......................   Passed    0.01 sec
      Start 19: HookRegistrationTest.orTagsAreEnforced
19/88 Test #19: HookRegistrationTest.orTagsAreEnforced ...........................................   Passed    0.00 sec
      Start 20: HookRegistrationTest.andTagsAreEnforced
20/88 Test #20: HookRegistrationTest.andTagsAreEnforced ..........................................   Passed    0.01 sec
      Start 21: SocketServerTest.exitsOnFirstConnectionClosed
21/88 Test #21: SocketServerTest.exitsOnFirstConnectionClosed ....................................   Passed    0.01 sec
      Start 22: SocketServerTest.moreThanOneClientCanConnect
22/88 Test #22: SocketServerTest.moreThanOneClientCanConnect .....................................   Passed    0.00 sec
      Start 23: SocketServerTest.receiveAndSendsSingleLineMassages
23/88 Test #23: SocketServerTest.receiveAndSendsSingleLineMassages ...............................   Passed    0.01 sec
      Start 24: WireMessageCodecTest.decodesUnknownOrMalformedMessage
24/88 Test #24: WireMessageCodecTest.decodesUnknownOrMalformedMessage ............................   Passed    0.01 sec
      Start 25: WireMessageCodecTest.handlesStepMatchesMessage
25/88 Test #25: WireMessageCodecTest.handlesStepMatchesMessage ...................................   Passed    0.01 sec
      Start 26: WireMessageCodecTest.handlesBeginScenarioMessageWithoutArgument
26/88 Test #26: WireMessageCodecTest.handlesBeginScenarioMessageWithoutArgument ..................   Passed    0.01 sec
      Start 27: WireMessageCodecTest.handlesBeginScenarioMessageWithTagsArgument
27/88 Test #27: WireMessageCodecTest.handlesBeginScenarioMessageWithTagsArgument .................   Passed    0.01 sec
      Start 28: WireMessageCodecTest.handlesBeginScenarioMessageWithNullArgument
28/88 Test #28: WireMessageCodecTest.handlesBeginScenarioMessageWithNullArgument .................   Passed    0.01 sec
      Start 29: WireMessageCodecTest.handlesInvokeMessageWithNoArgs
29/88 Test #29: WireMessageCodecTest.handlesInvokeMessageWithNoArgs ..............................   Passed    0.00 sec
      Start 30: WireMessageCodecTest.handlesInvokeMessageWithoutTableArgs
30/88 Test #30: WireMessageCodecTest.handlesInvokeMessageWithoutTableArgs ........................   Passed    0.01 sec
      Start 31: WireMessageCodecTest.handlesInvokeMessageWithTableArgs
31/88 Test #31: WireMessageCodecTest.handlesInvokeMessageWithTableArgs ...........................   Passed    0.01 sec
      Start 32: WireMessageCodecTest.handlesInvokeMessageWithNullArg
32/88 Test #32: WireMessageCodecTest.handlesInvokeMessageWithNullArg .............................   Passed    0.01 sec
      Start 33: WireMessageCodecTest.handlesEndScenarioMessageWithoutArgument
33/88 Test #33: WireMessageCodecTest.handlesEndScenarioMessageWithoutArgument ....................   Passed    0.01 sec
      Start 34: WireMessageCodecTest.handlesEndScenarioMessageWithNullArgument
34/88 Test #34: WireMessageCodecTest.handlesEndScenarioMessageWithNullArgument ...................   Passed    0.01 sec
      Start 35: WireMessageCodecTest.handlesEndScenarioMessageWithTagsArgument
35/88 Test #35: WireMessageCodecTest.handlesEndScenarioMessageWithTagsArgument ...................   Passed    0.00 sec
      Start 36: WireMessageCodecTest.handlesSnippetTextMessage
36/88 Test #36: WireMessageCodecTest.handlesSnippetTextMessage ...................................   Passed    0.01 sec
      Start 37: WireMessageCodecTest.handlesSuccessResponse
37/88 Test #37: WireMessageCodecTest.handlesSuccessResponse ......................................   Passed    0.00 sec
      Start 38: WireMessageCodecTest.handlesSimpleFailureResponse
38/88 Test #38: WireMessageCodecTest.handlesSimpleFailureResponse ................................   Passed    0.01 sec
      Start 39: WireMessageCodecTest.handlesDetailedFailureResponse
39/88 Test #39: WireMessageCodecTest.handlesDetailedFailureResponse ..............................   Passed    0.00 sec
      Start 40: WireMessageCodecTest.handlesPendingResponse
40/88 Test #40: WireMessageCodecTest.handlesPendingResponse ......................................   Passed    0.01 sec
      Start 41: WireMessageCodecTest.handlesEmptyStepMatchesResponse
41/88 Test #41: WireMessageCodecTest.handlesEmptyStepMatchesResponse .............................   Passed    0.01 sec
      Start 42: WireMessageCodecTest.handlesStepMatchesResponse
42/88 Test #42: WireMessageCodecTest.handlesStepMatchesResponse ..................................   Passed    0.01 sec
      Start 43: WireMessageCodecTest.handlesSnippetTextResponse
43/88 Test #43: WireMessageCodecTest.handlesSnippetTextResponse ..................................   Passed    0.01 sec
      Start 44: WireCommandsTest.succesfulInvokeReturnsSuccess
44/88 Test #44: WireCommandsTest.succesfulInvokeReturnsSuccess ...................................   Passed    0.01 sec
      Start 45: WireCommandsTest.throwingFailureInvokeReturnsFailure
45/88 Test #45: WireCommandsTest.throwingFailureInvokeReturnsFailure .............................   Passed    0.01 sec
      Start 46: WireCommandsTest.throwingPendingStepReturnsPending
46/88 Test #46: WireCommandsTest.throwingPendingStepReturnsPending ...............................   Passed    0.01 sec
      Start 47: WireCommandsTest.throwingAnythingInvokeReturnsFailure
47/88 Test #47: WireCommandsTest.throwingAnythingInvokeReturnsFailure ............................   Passed    0.01 sec
      Start 48: BasicStepTest.handlesPendingSteps
48/88 Test #48: BasicStepTest.handlesPendingSteps ................................................   Passed    0.01 sec
      Start 49: ContextManagerTest.createsValidContextPointers
49/88 Test #49: ContextManagerTest.createsValidContextPointers ...................................   Passed    0.00 sec
      Start 50: ContextManagerTest.allowsCreatingTheSameContextTypeTwice
50/88 Test #50: ContextManagerTest.allowsCreatingTheSameContextTypeTwice .........................   Passed    0.01 sec
      Start 51: ContextManagerTest.purgesContexts
51/88 Test #51: ContextManagerTest.purgesContexts ................................................   Passed    0.01 sec
      Start 52: CukeCommandsTest.matchesCorrectly
52/88 Test #52: CukeCommandsTest.matchesCorrectly ................................................   Passed    0.01 sec
      Start 53: CukeCommandsTest.invokeHandlesParametersWithoutMacro
53/88 Test #53: CukeCommandsTest.invokeHandlesParametersWithoutMacro .............................   Passed    0.01 sec
      Start 54: CukeCommandsTest.invokeHandlesParametersWithMacro
54/88 Test #54: CukeCommandsTest.invokeHandlesParametersWithMacro ................................   Passed    0.00 sec
      Start 55: RegexTest.matchesSimpleRegex
55/88 Test #55: RegexTest.matchesSimpleRegex .....................................................   Passed    0.01 sec
      Start 56: RegexTest.matchesRegexWithoutSubmatches
56/88 Test #56: RegexTest.matchesRegexWithoutSubmatches ..........................................   Passed    0.01 sec
      Start 57: RegexTest.matchesRegexWithSubmatches
57/88 Test #57: RegexTest.matchesRegexWithSubmatches .............................................   Passed    0.01 sec
      Start 58: RegexTest.findAllDoesNotMatchIfNoTokens
58/88 Test #58: RegexTest.findAllDoesNotMatchIfNoTokens ..........................................   Passed    0.01 sec
      Start 59: RegexTest.findAllExtractsTheFirstGroupOfEveryToken
59/88 Test #59: RegexTest.findAllExtractsTheFirstGroupOfEveryToken ...............................   Passed    0.00 sec
      Start 60: RegexTest.findAllHasToMatchTheEntireInput
60/88 Test #60: RegexTest.findAllHasToMatchTheEntireInput ........................................   Passed    0.01 sec
      Start 61: StepCallChainTest.failsIfNoStep
61/88 Test #61: StepCallChainTest.failsIfNoStep ..................................................   Passed    0.00 sec
      Start 62: StepCallChainTest.stepExecutionReturnsTheExpectedResult
62/88 Test #62: StepCallChainTest.stepExecutionReturnsTheExpectedResult ..........................   Passed    0.01 sec
      Start 63: StepCallChainTest.aroundHooksAreInvokedInTheCorrectOrder
63/88 Test #63: StepCallChainTest.aroundHooksAreInvokedInTheCorrectOrder .........................   Passed    0.00 sec
      Start 64: StepCallChainTest.argsArePassedToTheStep
64/88 Test #64: StepCallChainTest.argsArePassedToTheStep .........................................   Passed    0.01 sec
      Start 65: StepCallChainTest.aroundHooksCanStopTheCallChain
65/88 Test #65: StepCallChainTest.aroundHooksCanStopTheCallChain .................................   Passed    0.01 sec
      Start 66: StepManagerTest.holdsNonConflictingSteps
66/88 Test #66: StepManagerTest.holdsNonConflictingSteps .........................................   Passed    0.01 sec
      Start 67: StepManagerTest.holdsConflictingSteps
67/88 Test #67: StepManagerTest.holdsConflictingSteps ............................................   Passed    0.00 sec
      Start 68: StepManagerTest.matchesStepsWithNonRegExMatchers
68/88 Test #68: StepManagerTest.matchesStepsWithNonRegExMatchers .................................   Passed    0.01 sec
      Start 69: StepManagerTest.matchesStepsWithRegExMatchers
69/88 Test #69: StepManagerTest.matchesStepsWithRegExMatchers ....................................   Passed    0.01 sec
      Start 70: StepManagerTest.extractsParamsFromRegExMatchers
70/88 Test #70: StepManagerTest.extractsParamsFromRegExMatchers ..................................   Passed    0.01 sec
      Start 71: StepManagerTest.handlesMultipleMatches
71/88 Test #71: StepManagerTest.handlesMultipleMatches ...........................................   Passed    0.01 sec
      Start 72: StepManagerTest.matchesStepsWithNonAsciiMatchers
72/88 Test #72: StepManagerTest.matchesStepsWithNonAsciiMatchers .................................   Passed    0.01 sec
      Start 73: TableTest.forbidsRowsNotMatchingTableColumnsSize
73/88 Test #73: TableTest.forbidsRowsNotMatchingTableColumnsSize .................................   Passed    0.01 sec
      Start 74: TableTest.rowsCannotBeAddedBeforeColumnsAreSet
74/88 Test #74: TableTest.rowsCannotBeAddedBeforeColumnsAreSet ...................................   Passed    0.01 sec
      Start 75: TableTest.columnsCannotBeChangesAfterRowsAreAdded
75/88 Test #75: TableTest.columnsCannotBeChangesAfterRowsAreAdded ................................   Passed    0.00 sec
      Start 76: TableTest.addedRowsMatchColumnDefinition
76/88 Test #76: TableTest.addedRowsMatchColumnDefinition .........................................   Passed    0.00 sec
      Start 77: TagTest.emptyOrExpressionMatchesNoTag
77/88 Test #77: TagTest.emptyOrExpressionMatchesNoTag ............................................   Passed    0.01 sec
      Start 78: TagTest.orExpressionsMatchTheTagSpecified
78/88 Test #78: TagTest.orExpressionsMatchTheTagSpecified ........................................   Passed    0.00 sec
      Start 79: TagTest.orExpressionsMatchAnyTagSpecified
79/88 Test #79: TagTest.orExpressionsMatchAnyTagSpecified ........................................   Passed    0.01 sec
      Start 80: TagTest.orExpressionsAllowSpaces
80/88 Test #80: TagTest.orExpressionsAllowSpaces .................................................   Passed    0.00 sec
      Start 81: TagTest.emptyAndExpressionMatchesAnyTag
81/88 Test #81: TagTest.emptyAndExpressionMatchesAnyTag ..........................................   Passed    0.01 sec
      Start 82: TagTest.singleAndExpressionMatchesTheTagSpecified
82/88 Test #82: TagTest.singleAndExpressionMatchesTheTagSpecified ................................   Passed    0.01 sec
      Start 83: TagTest.andExpressionsMatchEveryTagSpecified
83/88 Test #83: TagTest.andExpressionsMatchEveryTagSpecified .....................................   Passed    0.01 sec
      Start 84: TagTest.andExpressionsAllowSpaces
84/88 Test #84: TagTest.andExpressionsAllowSpaces ................................................   Passed    0.01 sec
      Start 85: TagTest.compositeTagExpressionsAreHandled
85/88 Test #85: TagTest.compositeTagExpressionsAreHandled ........................................   Passed    0.01 sec
      Start 86: GTestDriverTest
86/88 Test #86: GTestDriverTest ..................................................................   Passed    0.01 sec
      Start 87: BoostDriverTest
87/88 Test #87: BoostDriverTest ..................................................................   Passed    0.01 sec
      Start 88: GenericDriverTest
88/88 Test #88: GenericDriverTest ................................................................   Passed    0.01 sec

100% tests passed, 0 tests failed out of 88

Total Test time (real) =   0.72 sec
[ 30%] Built target gmock
[100%] Built target cucumber-cpp
Ignoring eventmachine-1.0.9.1 because its extensions are not built.  Try: gem pristine eventmachine --version 1.0.9.1
Ignoring fast-stemmer-1.0.2 because its extensions are not built.  Try: gem pristine fast-stemmer --version 1.0.2
Ignoring gherkin-2.12.2 because its extensions are not built.  Try: gem pristine gherkin --version 2.12.2
Ignoring http_parser.rb-0.6.0 because its extensions are not built.  Try: gem pristine http_parser.rb --version 0.6.0
Ignoring jazzy-0.6.0 because its extensions are not built.  Try: gem pristine jazzy --version 0.6.0
Ignoring posix-spawn-0.3.11 because its extensions are not built.  Try: gem pristine posix-spawn --version 0.3.11
Ignoring redcarpet-3.3.4 because its extensions are not built.  Try: gem pristine redcarpet --version 3.3.4
UUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUU

49 scenarios (49 undefined)
214 steps (214 undefined)
0m0.141s

You can implement step definitions for undefined steps with these snippets:

Given(/^the following feature:$/) do |string|
  pending # Write code here that turns the phrase above into concrete actions
end

When(/^Cucumber runs the feature$/) do
  pending # Write code here that turns the phrase above into concrete actions
end

Then(/^the feature passes$/) do
  pending # Write code here that turns the phrase above into concrete actions
end

Given(/^a scenario with:$/) do |string|
  pending # Write code here that turns the phrase above into concrete actions
end

Given(/^the step "([^"]*)" has a passing mapping$/) do |arg1|
  pending # Write code here that turns the phrase above into concrete actions
end

When(/^Cucumber executes the scenario$/) do
  pending # Write code here that turns the phrase above into concrete actions
end

Then(/^the scenario passes$/) do
  pending # Write code here that turns the phrase above into concrete actions
end

Given(/^the step "([^"]*)" has a failing mapping$/) do |arg1|
  pending # Write code here that turns the phrase above into concrete actions
end

Then(/^the scenario fails$/) do
  pending # Write code here that turns the phrase above into concrete actions
end

Then(/^the step "([^"]*)" is skipped$/) do |arg1|
  pending # Write code here that turns the phrase above into concrete actions
end

Given(/^the step "([^"]*)" has a pending mapping$/) do |arg1|
  pending # Write code here that turns the phrase above into concrete actions
end

Then(/^the scenario is pending$/) do
  pending # Write code here that turns the phrase above into concrete actions
end

Then(/^the scenario is undefined$/) do
  pending # Write code here that turns the phrase above into concrete actions
end

When(/^Cucumber runs the scenario with steps for a calculator$/) do
  pending # Write code here that turns the phrase above into concrete actions
end

Given(/^the step "([^"]*)" has a passing mapping that receives a data table$/) do |arg1|
  pending # Write code here that turns the phrase above into concrete actions
end

Then(/^the received data table array equals the following:$/) do |string|
  pending # Write code here that turns the phrase above into concrete actions
end

Given(/^the following data table in a step:$/) do |string|
  pending # Write code here that turns the phrase above into concrete actions
end

When(/^the data table is passed to a step mapping that converts it to key\/value pairs$/) do
  pending # Write code here that turns the phrase above into concrete actions
end

Then(/^the data table is converted to the following:$/) do |string|
  pending # Write code here that turns the phrase above into concrete actions
end

When(/^the data table is passed to a step mapping that gets the row arrays without the header$/) do
  pending # Write code here that turns the phrase above into concrete actions
end

Given(/^the step "([^"]*)" has a mapping failing with the message "([^"]*)"$/) do |arg1, arg2|
  pending # Write code here that turns the phrase above into concrete actions
end

Then(/^the failure message "([^"]*)" is output$/) do |arg1|
  pending # Write code here that turns the phrase above into concrete actions
end

Then(/^the scenario called "([^"]*)" is reported as failing$/) do |arg1|
  pending # Write code here that turns the phrase above into concrete actions
end

Then(/^the scenario called "([^"]*)" is not reported as failing$/) do |arg1|
  pending # Write code here that turns the phrase above into concrete actions
end

Given(/^a passing before hook$/) do
  pending # Write code here that turns the phrase above into concrete actions
end

Given(/^a passing after hook$/) do
  pending # Write code here that turns the phrase above into concrete actions
end

When(/^Cucumber executes a scenario$/) do
  pending # Write code here that turns the phrase above into concrete actions
end

Then(/^the before hook is fired before the scenario$/) do
  pending # Write code here that turns the phrase above into concrete actions
end

Then(/^the after hook is fired after the scenario$/) do
  pending # Write code here that turns the phrase above into concrete actions
end

Given(/^a passing around hook$/) do
  pending # Write code here that turns the phrase above into concrete actions
end

Then(/^the around hook fires around the scenario$/) do
  pending # Write code here that turns the phrase above into concrete actions
end

Then(/^the around hook is fired around the other hooks$/) do
  pending # Write code here that turns the phrase above into concrete actions
end

Given(/^a hook tagged with "([^"]*)"$/) do |arg1|
  pending # Write code here that turns the phrase above into concrete actions
end

When(/^Cucumber executes a scenario tagged with "([^"]*)"$/) do |arg1|
  pending # Write code here that turns the phrase above into concrete actions
end

Then(/^the hook is fired$/) do
  pending # Write code here that turns the phrase above into concrete actions
end

Then(/^the hook is not fired$/) do
  pending # Write code here that turns the phrase above into concrete actions
end

When(/^Cucumber executes a scenario with no tags$/) do
  pending # Write code here that turns the phrase above into concrete actions
end

Given(/^an untagged hook$/) do
  pending # Write code here that turns the phrase above into concrete actions
end

Given(/^a scenario tagged with "([^"]*)"$/) do |arg1|
  pending # Write code here that turns the phrase above into concrete actions
end

When(/^Cucumber executes scenarios tagged with "([^"]*)"$/) do |arg1|
  pending # Write code here that turns the phrase above into concrete actions
end

Then(/^only the first scenario is executed$/) do
  pending # Write code here that turns the phrase above into concrete actions
end

When(/^Cucumber executes scenarios not tagged with "([^"]*)"$/) do |arg1|
  pending # Write code here that turns the phrase above into concrete actions
end

When(/^Cucumber executes scenarios tagged with "([^"]*)" or "([^"]*)"$/) do |arg1, arg2|
  pending # Write code here that turns the phrase above into concrete actions
end

Then(/^only the first two scenarios are executed$/) do
  pending # Write code here that turns the phrase above into concrete actions
end

Given(/^a scenario tagged with "([^"]*)" and "([^"]*)"$/) do |arg1, arg2|
  pending # Write code here that turns the phrase above into concrete actions
end

When(/^Cucumber executes scenarios tagged with both "([^"]*)" and "([^"]*)"$/) do |arg1, arg2|
  pending # Write code here that turns the phrase above into concrete actions
end

When(/^Cucumber executes scenarios not tagged with "([^"]*)" nor "([^"]*)"$/) do |arg1, arg2|
  pending # Write code here that turns the phrase above into concrete actions
end

Then(/^only the third scenario is executed$/) do
  pending # Write code here that turns the phrase above into concrete actions
end

When(/^Cucumber executes scenarios not tagged with both "([^"]*)" and "([^"]*)"$/) do |arg1, arg2|
  pending # Write code here that turns the phrase above into concrete actions
end

Then(/^only the second, third and fourth scenarios are executed$/) do
  pending # Write code here that turns the phrase above into concrete actions
end

When(/^Cucumber executes scenarios tagged with "([^"]*)" or without "([^"]*)"$/) do |arg1, arg2|
  pending # Write code here that turns the phrase above into concrete actions
end

Given(/^a scenario tagged with "([^"]*)", "([^"]*)" and "([^"]*)"$/) do |arg1, arg2, arg3|
  pending # Write code here that turns the phrase above into concrete actions
end

When(/^Cucumber executes scenarios tagged with "([^"]*)" but not with both "([^"]*)" and "([^"]*)"$/) do |arg1, arg2, arg3|
  pending # Write code here that turns the phrase above into concrete actions
end

Given(/^a feature tagged with "([^"]*)"$/) do |arg1|
  pending # Write code here that turns the phrase above into concrete actions
end

Given(/^a scenario without any tags$/) do
  pending # Write code here that turns the phrase above into concrete actions
end

Then(/^the scenario is executed$/) do
  pending # Write code here that turns the phrase above into concrete actions
end

Given(/^the step "([^"]*)" has no mapping$/) do |arg1|
  pending # Write code here that turns the phrase above into concrete actions
end

Then(/^a "([^"]*)" step definition snippet for \/\^I am a veggie\$\/ is suggested$/) do |arg1|
  pending # Write code here that turns the phrase above into concrete actions
end

Then(/^a "([^"]*)" step definition snippet for \/\^I eat meat\$\/ is suggested$/) do |arg1|
  pending # Write code here that turns the phrase above into concrete actions
end

Then(/^a "([^"]*)" step definition snippet for \/\^I get sick\$\/ is suggested$/) do |arg1|
  pending # Write code here that turns the phrase above into concrete actions
end

Given(/^the steps have no mappings$/) do
  pending # Write code here that turns the phrase above into concrete actions
end

Then(/^a "([^"]*)" step definition snippet for \/\^I love food\$\/ is suggested$/) do |arg1|
  pending # Write code here that turns the phrase above into concrete actions
end

Then(/^a "([^"]*)" step definition snippet for \/\^I eat gherkins\$\/ is suggested$/) do |arg1|
  pending # Write code here that turns the phrase above into concrete actions
end

Then(/^a "([^"]*)" step definition snippet for \/\^I eat cucumbers\$\/ is suggested$/) do |arg1|
  pending # Write code here that turns the phrase above into concrete actions
end

Then(/^a "([^"]*)" step definition snippet for \/\^I feel satiated\$\/ is suggested$/) do |arg1|
  pending # Write code here that turns the phrase above into concrete actions
end

Then(/^a "([^"]*)" step definition snippet for \/\^I feel energized\$\/ is suggested$/) do |arg1|
  pending # Write code here that turns the phrase above into concrete actions
end

Then(/^a "([^"]*)" step definition snippet for \/\^I have nothing left to eat\$\/ is suggested$/) do |arg1|
  pending # Write code here that turns the phrase above into concrete actions
end

Then(/^a "([^"]*)" step definition snippet for \/\^the following Wikipedia excerpt:\$\/ with a doc string is suggested$/) do |arg1|
  pending # Write code here that turns the phrase above into concrete actions
end

Then(/^a "([^"]*)" step definition snippet for \/\^the following cucumbers:\$\/ with a data table is suggested$/) do |arg1|
  pending # Write code here that turns the phrase above into concrete actions
end

Given(/^a World variable initialized to (\d+)$/) do |arg1|
  pending # Write code here that turns the phrase above into concrete actions
end

When(/^Cucumber executes a scenario that increments the World variable by (\d+)$/) do |arg1|
  pending # Write code here that turns the phrase above into concrete actions
end

Then(/^the World variable should have contained (\d+) at the end of the scenario$/) do |arg1|
  pending # Write code here that turns the phrase above into concrete actions
end

When(/^Cucumber executes two scenarios that increment the World variable by (\d+)$/) do |arg1|
  pending # Write code here that turns the phrase above into concrete actions
end

Then(/^the World variable should have contained (\d+) at the end of the first scenario$/) do |arg1|
  pending # Write code here that turns the phrase above into concrete actions
end

Then(/^the World variable should have contained (\d+) at the end of the second scenario$/) do |arg1|
  pending # Write code here that turns the phrase above into concrete actions
end

Given(/^a World function$/) do
  pending # Write code here that turns the phrase above into concrete actions
end

When(/^Cucumber executes a scenario that calls the World function$/) do
  pending # Write code here that turns the phrase above into concrete actions
end

Then(/^the World function should have been called$/) do
  pending # Write code here that turns the phrase above into concrete actions
end

Given(/^a custom World constructor$/) do
  pending # Write code here that turns the phrase above into concrete actions
end

Then(/^the scenario output should contain:$/) do |string|
  pending # Write code here that turns the phrase above into concrete actions
end

Then(/^the scenario output should not contain:$/) do |string|
  pending # Write code here that turns the phrase above into concrete actions
end

Given(/^a step definition file with:$/) do |string|
  pending # Write code here that turns the phrase above into concrete actions
end

Then(/^the step output should contain:$/) do |string|
  pending # Write code here that turns the phrase above into concrete actions
end

[100%] Built target features
bind: Address already in use
Ignoring eventmachine-1.0.9.1 because its extensions are not built.  Try: gem pristine eventmachine --version 1.0.9.1
Ignoring fast-stemmer-1.0.2 because its extensions are not built.  Try: gem pristine fast-stemmer --version 1.0.2
Ignoring gherkin-2.12.2 because its extensions are not built.  Try: gem pristine gherkin --version 2.12.2
Ignoring http_parser.rb-0.6.0 because its extensions are not built.  Try: gem pristine http_parser.rb --version 0.6.0
Ignoring jazzy-0.6.0 because its extensions are not built.  Try: gem pristine jazzy --version 0.6.0
Ignoring posix-spawn-0.3.11 because its extensions are not built.  Try: gem pristine posix-spawn --version 0.3.11
Ignoring redcarpet-3.3.4 because its extensions are not built.  Try: gem pristine redcarpet --version 3.3.4
Ignoring sqlite3-1.3.11 because its extensions are not built.  Try: gem pristine sqlite3 --version 1.3.11
Ignoring yajl-ruby-1.2.1 because its extensions are not built.  Try: gem pristine yajl-ruby --version 1.2.1
Feature: Addition
  In order to avoid silly mistakes
  As a math idiot
  I want to be told the sum of two numbers

  Scenario Outline: Add two numbers                    # examples/Calc/features/addition.feature:7
    Given I have entered <input_1> into the calculator # examples/Calc/features/addition.feature:8
    And I have entered <input_2> into the calculator   # examples/Calc/features/addition.feature:9
    When I press <button>                              # examples/Calc/features/addition.feature:10
    Then the result should be <output> on the screen   # examples/Calc/features/addition.feature:11

    Examples:
      | input_1 | input_2 | button | output |
      no implicit conversion of nil into String (TypeError)
      ./features/support/hooks.rb:4:in `exists?'
      ./features/support/hooks.rb:4:in `Before'
      | 20      | 30      | add    | 50     |
      no implicit conversion of nil into String (TypeError)
      ./features/support/hooks.rb:4:in `exists?'
      ./features/support/hooks.rb:4:in `Before'
      | 2       | 5       | add    | 7      |
      no implicit conversion of nil into String (TypeError)
      ./features/support/hooks.rb:4:in `exists?'
      ./features/support/hooks.rb:4:in `Before'
      | 0       | 40      | add    | 40     |

Feature: Division
  In order to avoid silly mistakes
  Cashiers must be able to calculate a fraction

  Scenario: Regular numbers                     # examples/Calc/features/division.feature:6
  no implicit conversion of nil into String (TypeError)
  ./features/support/hooks.rb:4:in `exists?'
  ./features/support/hooks.rb:4:in `Before'
    Given I have entered 3 into the calculator  # examples/Calc/features/division.feature:7
    And I have entered 2 into the calculator    # examples/Calc/features/division.feature:8
    When I press divide                         # examples/Calc/features/division.feature:9
    Then the result should be 1.5 on the screen # examples/Calc/features/division.feature:10

Failing Scenarios:
cucumber examples/Calc/features/addition.feature:15 # Scenario Outline: Add two numbers, Examples (#1)
cucumber examples/Calc/features/addition.feature:16 # Scenario Outline: Add two numbers, Examples (#2)
cucumber examples/Calc/features/addition.feature:17 # Scenario Outline: Add two numbers, Examples (#3)
cucumber examples/Calc/features/division.feature:6 # Scenario: Regular numbers

4 scenarios (4 failed)
16 steps (16 undefined)
0m0.035s

You can implement step definitions for undefined steps with these snippets:

Given(/^I have entered (\d+) into the calculator$/) do |arg1|
  pending # Write code here that turns the phrase above into concrete actions
end

When(/^I press add$/) do
  pending # Write code here that turns the phrase above into concrete actions
end

Then(/^the result should be (\d+) on the screen$/) do |arg1|
  pending # Write code here that turns the phrase above into concrete actions
end

When(/^I press divide$/) do
  pending # Write code here that turns the phrase above into concrete actions
end

Then(/^the result should be (\d+)\.(\d+) on the screen$/) do |arg1, arg2|
  pending # Write code here that turns the phrase above into concrete actions
end

@konserw
Copy link
Contributor Author

konserw commented Jul 19, 2016

i think something is wrong with your envronment as everything is undefined including cucumber-tck that i haven't changed and all passes on CI...

@paoloambrosio
Copy link
Member

Quick notes:

  • try and see what other characters need to be escaped (every special character in regexes)
  • I don't see much the point in the negative scenario
  • I would write more detailed test cases in unit tests and have a scenario with all special characters

...but in general a big 👍 for the feature file in the "specific" section :-)

@MartinDelille
Copy link
Contributor

@konserw How can I check my env is ok?

@konserw
Copy link
Contributor Author

konserw commented Jul 20, 2016

@MartinDelille not sure. At some point I've removed all ruby'ish :P You can try using RVM to change ruby version, or remove all gems
@paoloambrosio
other characters -> I could do that
negative scenario -> it is because at some point positive scenario was passing without change of cucumber-cpp output
unitTest -> I'll try, but I'm not very good at it :P

@MartinDelille
Copy link
Contributor

@konserw There is indeed something wrong with my ruby/gem configuration, I'll try again when I'll find time to fix it.

#include <vector>
#else
#include <array>
#endif
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not in favour of duplicating the test that needs to be done to test both implementations. For now I'd stick to not using C++11. In the long run I'd rather do dynamic loading of step definitions so that they can be compiled separately from the core and convert it to C++11.

@paoloambrosio
Copy link
Member

paoloambrosio commented Jul 29, 2016

In general it is missing some of the special characters in regexes.

The feature description is talking about testing. Cucumber is about communication!

In order to copy and paste the undefined steps snippets
As a developer
I want the regex string to be correctly escaped

It might also be a good idea to use scenario outlines instead of copy/paste/change of the same feature. Your scenarios transformed in a Scenario Outline:

Scenario Outline: <characters> in step definition
  Given the following feature:
    """
    Feature: Escaping

      Scenario: <characters>
        Given the step contains '<scenario step string>'
    """
    When Cucumber runs the feature
    Then the scenario is undefined
    And  the scenario output should contain:
      """
      GIVEN("^the step contains '<step definition string>'$") {
          pending();
      }
      """
  Examples:
    | characters      | scenario step string | step definition string |
    | Double quotes   | "                    | \"                     |
    | Backslash       | \                    | \\\\                   |
    | Dot             | .                    | \\.                    |
    | Caret           | ^                    | \\^                    |
    | Dollar          | $                    | \\$                    |
    | Square brackets | []                   | \\[\\]                 |
    ...

Second iteration:

  • remove incidental details
    • removed Then the scenario is undefined
    • used Given a scenario with instead of Given the following feature
  • looked at the undefined_steps.feature
    • added And the steps have no mappings that is important
    • changed the scenario output should contain with the a more focused step (I was undecided on this, but the format is not important in this scenario)

Final result:

Scenario Outline: <characters> in step definition
  Given a scenario with:
    """
    Given the step contains '<scenario step string>'
    """
  And the steps have no mappings
  When Cucumber executes the scenario
  Then a step definition snippet with "^the step contains '<step definition string>'$" is suggested

  Examples:
    | characters      | scenario step string | step definition string |
    | Double quotes   | "                    | \"                     |
    | Backslash       | \                    | \\\\                   |
    | Dot             | .                    | \\.                    |
    | Caret           | ^                    | \\^                    |
    | Dollar          | $                    | \\$                    |
    | Square brackets | []                   | \\[\\]                 |
    ...

Edit: the Examples block is wrong and doesn't take Gherkin escaping into consideration

@konserw
Copy link
Contributor Author

konserw commented Aug 1, 2016

I had this feeling that copy-paste was wrong way to do it - thank you ;)

@konserw
Copy link
Contributor Author

konserw commented Aug 5, 2016

Double quote scenario appears as undefined - do you know how to fix that? Probably I got my step definition wrong?

@konserw
Copy link
Contributor Author

konserw commented Aug 11, 2016

Please check now if it is all ok

@paoloambrosio
Copy link
Member

paoloambrosio commented Aug 14, 2016

Thanks for your contribution but I don't think your current implementation is correct, and e2e tests pass because the feature file is incorrect (perhaps you fixed the scenario based on the result of your implementation instead of the other way around?). Try to add this feature to the Calc example:

Feature: Escaping

  Scenario:
    Given an escaping pattern '[{}$^|"]'

Your snippet is

GIVEN("^an escaping pattern '\[\{\}\$\^\|\"\]'$") {
    pending();
}

that doesn't compile.

Spent a lot of time today trying to understand the bizarre escaping in Gherkin, and came up with paoloambrosio/cucumber-cpp@07d7e6b (konserw-issue79 branch). I've also refactored the code splitting the escaping of the two, regex and c-string, as well as added unit tests. With that the generated snippet for the aforementioned feature is

GIVEN("^an escaping pattern '\\[\\{\\}\\$\\^\\|\"\\]'$") {
    pending();
}

that compiles and matches.

Feel free to squash your commits and pull mine into this PR.

@paoloambrosio
Copy link
Member

BTW, I've created cucumber/cucumber-ruby#1006 for the bizarre escaping in Cucumber-Ruby.

konserw and others added 2 commits September 9, 2016 22:16
Introduced unit tests
Fixed feature file, with bizarre escaping behaviour
@konserw
Copy link
Contributor Author

konserw commented Sep 9, 2016

Done :)

paoloambrosio added a commit to paoloambrosio/cucumber-cpp that referenced this pull request Sep 17, 2016
paoloambrosio added a commit to paoloambrosio/cucumber-cpp that referenced this pull request Sep 17, 2016
@paoloambrosio paoloambrosio merged commit fbc49a3 into cucumber:master Sep 17, 2016
@paoloambrosio
Copy link
Member

Built this on my repo before merging as the build wasn't working in this branch. It worked in the end :) Finally merged!

@konserw konserw deleted the issue79 branch September 18, 2016 08:04
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants