Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Allow using Examples after Outline #122

Merged

Conversation

ilyapuchka
Copy link
Collaborator

@ilyapuchka ilyapuchka commented Aug 26, 2018

I noticed that there was an attempt in #14 to implement this to follow more closely standard Gherkin syntax, but it does not work well with escaping closures, so here is an alternative solution with trailing closure or parameters to pass examples after outline. Xcode indentation is a bit funky in these cases, so I'm not very confident in this approach.

Original solution for that could be possible if Gherkin syntax methods are moved out of XCTestCase and become global functions, but that will require storing a reference to currently executing test case in global variable which may lead to more complicated implementation, and will allow using these functions out of XCTestCase implementation, so is also not ideal 🤷‍♂️

Example:

        Outline({
             Given("I use the example name <name>")
             Then("The age should be <age>")
         }) {[
             [ "name",   "age", "height" ],
             [  "Alice",  "20",  "170"   ],
             [  "Bob",    "20",  "170"   ]
             ]}

         Outline({
             Given("I use the example name <name>")
             Then("The age should be <age>")
         }, Examples:
             [ "name",   "age", "height" ],
            [  "Alice",  "20",  "170"   ],
            [  "Bob",    "20",  "170"   ]
         )

@ilyapuchka
Copy link
Collaborator Author

@deanWombourne any thoughts on that?

@ilyapuchka ilyapuchka mentioned this pull request Oct 2, 2018
@ilyapuchka ilyapuchka requested review from deanWombourne and kerrmarin and removed request for deanWombourne November 26, 2018 13:43
Copy link
Member

@kerrmarin kerrmarin left a comment

Choose a reason for hiding this comment

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

Looks good, just that one question about the commented out exit code for the linter

@@ -464,7 +464,7 @@
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "pushd \"${SRCROOT}/..\"\n ./scripts/lint\n exit $?\npopd";
shellScript = "pushd \"${SRCROOT}/..\"\n ./scripts/lint\n#exit $?\npopd";
Copy link
Member

Choose a reason for hiding this comment

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

Is this intentional?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

no, I forgot to remove it 🤦‍♂️

Copy link
Contributor

@deanWombourne deanWombourne left a comment

Choose a reason for hiding this comment

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

Sorry, really thought I'd approved this ages ago!

@ilyapuchka ilyapuchka merged commit c993db6 into net-a-porter-mobile:master Dec 17, 2018
@ilyapuchka ilyapuchka deleted the examples-after-outline branch December 17, 2018 15:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants