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

Fix features and scenario names do not display when PesterResult is printed to the console #1138

Conversation

fourpastmidnight
Copy link
Contributor

@fourpastmidnight fourpastmidnight commented Nov 3, 2018

1. General summary of the pull request

I used the -PassThru parameter of Invoke-Gherkin and discovered that feature names simply displayed as Gherkin.Ast.Feature, and likewise, scenario names displayed as Gherkin.Ast.Scenario. This isn't helpful. So this pull request adds the file Gherkin.types.ps1xml which adds "overrides" of the ToString method as ScriptMethod methods to the Gherkin.Ast.Feature and Gherkin.Ast.Scenario objects.

This fixes #1136

@fourpastmidnight fourpastmidnight force-pushed the fix-features-and-scenario-names-do-not-display-in-test-report branch from 8a9fb14 to 58286cd Compare November 5, 2018 14:47
This commit adds a types.ps1xml file to add an "override" of the
ToString method as a ScriptMethod to Gherkin.Ast.Feature objects. This
will allow the feature names to be displayed when using -PassThru with
Invoke-Gherkin and printing the PesterResult object to the console.
When enumerating the Gherkin scenarios, if there are scenario example
tables, the scenario name is augmented to append a newline and then the
text 'Examples:' followed by the name of the example table (if
provided). This change, instead, appends 'Examples: ' to the scenario
name to provide a space between 'Examples:' and the name of the examples
table.
This commit updates the Gherkin.types.ps1xml file to add an "override"
of the ToString method as a ScriptMethod to Gherkin.Ast.Scenario
objects. This will allow the scenario names to be displayed when using
-PassThru with Invoke-Gherkin and printing the PesterResult object to
the console.
@fourpastmidnight fourpastmidnight force-pushed the fix-features-and-scenario-names-do-not-display-in-test-report branch from 58286cd to 5d3e27c Compare December 6, 2018 19:01
@nohwnd nohwnd merged commit d88101a into pester:master Dec 14, 2018
@fourpastmidnight fourpastmidnight deleted the fix-features-and-scenario-names-do-not-display-in-test-report branch December 16, 2018 20:52
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.

PesterResult does not display Feature and Scenario names when printed to the console
2 participants