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

Do not create test cases for scenarios with no steps. #144

Merged
merged 1 commit into from
Aug 6, 2017

Conversation

brasmusson
Copy link
Contributor

Summary

Do not create test cases for scenarios with no steps.

Details

To be consistent with the (Pickle) compiler in the Gherkin library, test cases should not be created for scenarios with no steps.

Motivation and Context

Fixing the root cause of cucumber/common#243.

How Has This Been Tested?

The automated test suite has been updated to verify this behaviour.

I have manually verified that cucumber --dry-run with empty scenarios does not raise the exception of cucumber/common#243 with this change.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)

Checklist:

  • I've added tests for my code
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.

To be consistent with the (Pickle) compiler in the Gherkin library,
test cases should not be created for scenarios with no steps.
Copy link
Contributor

@olleolleolle olleolleolle left a comment

Choose a reason for hiding this comment

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

The change is very clear.

The test is concise.

@brasmusson brasmusson merged commit 16e4ed8 into master Aug 6, 2017
brasmusson added a commit that referenced this pull request Aug 6, 2017
@brasmusson brasmusson deleted the no-test-case-empty-scenarios branch August 6, 2017 19:32
@mattwynne
Copy link
Member

I know I'm late to the party, but IMO a scenario with no steps should result in a test case with an undefined status. If you think about the real-world use of an empty scenario, it's generally the starting point for growing it into a real scenario. I think having it count as "amber" in people's burn-up charts and so-on would be useful to them.

I guess the right place to have this discussion is around the Pickle compiler though, as that's what we need to move to ourselves.

@brasmusson
Copy link
Contributor Author

It was exactly because that the Gherkin compiler behaves this way, that I did not hesitate to fix the problem this way.

@aslakhellesoy
Copy link
Contributor

Makes sense, the gherkin compiler should produce pickles with an empty list of pickle steps.

@mattwynne
Copy link
Member

I opened a ticket here for us to discuss it.

@brasmusson
Copy link
Contributor Author

When we should handle Scenarios with no steps in Cucumber-Ruby, then we need to change the hooks and prepare world filters not to add hook steps if the incoming test case has no steps, because a test case with no steps should ... have no steps.

botandrose pushed a commit that referenced this pull request Aug 22, 2017
@mattwynne
Copy link
Member

Indeed.

netbsd-srcmastr pushed a commit to NetBSD/pkgsrc that referenced this pull request Mar 21, 2018
## [3.0.0](cucumber/cucumber-ruby-core@v3.0.0.pre.2...v3.0.0) (2017-09-27)

### Changed

* Step#name renamed to #text ([#137](cucumber/cucumber-ruby-core#137) [@olleolleolle](https://github.com/olleolleolle))
* Use past tense in event names (`xStarting` -> `xStarted`) (see [cucumber/cucumber-ruby#1166](cucumber/cucumber-ruby#1166) @brasmusson).

### Added

* Do not create test cases for scenarios with no steps ([#144](cucumber/cucumber-ruby-core#144) @brasmusson)
* Handle selective strict settings ([#143](cucumber/cucumber-ruby-core#143) @brasmusson)

### Fixed

* Fix DataTable's Location to be aware of all of its lines ([#142](cucumber/cucumber-ruby-core#142) @botandrose)

### Improved

* As per [#251](cucumber/common#251): renamed History.md to CHANGELOG.md, added contributing message at beginning, and misc formatting. ([#145](cucumber/cucumber-ruby-core#145) [jaysonesmith](https://github.com/jaysonesmith))

## [3.0.0.pre.2](cucumber/cucumber-ruby-core@v2.0.0...3.0.0.pre.2) (2017-07-26)

### New Features

* Add a flaky result type to be used for flaky scenarios ([#141](cucumber/cucumber-ruby-core#141), [cucumber/cucumber-ruby#1044](cucumber/cucumber-ruby#1044) @brasmusson)
* Make the Summary report able to say if the total result is ok ([#140](cucumber/cucumber-ruby-core#140) @brasmusson)
* Replay previous events to new subscribers ([#136](cucumber/cucumber-ruby-core#136) @mattwynne)
* Ruby 2.4.0 compatibility ([#120](cucumber/cucumber-ruby-core#120) @junaruga)
* Use tag expressions ([#116](cucumber/cucumber-ruby-core#116) @brasmusson)
* Access example table row data by param name ([#118](cucumber/cucumber-ruby-core#118) @enkessler)

### Bugfixes

N/A

### Removed Features

N/A

### Refactoring

* Travis: jruby-9.1.10.0 ([#130](cucumber/cucumber-ruby-core#130) @olleolleolle)
* Travis: jruby-9.1.12.0 ([#133](cucumber/cucumber-ruby-core#132) @olleolleolle)
@lock
Copy link

lock bot commented Oct 24, 2018

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot locked as resolved and limited conversation to collaborators Oct 24, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants