-
Notifications
You must be signed in to change notification settings - Fork 629
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
StepDefinitions should have at least one assert to call it as BDD test #80
Comments
I agree that "Then" step definitions should have at least one assert. But asserts should be optional for "Given" and "When" step definitions:
So the @given "I have {int} cukes in my belly" example should be replaced with a @then step definition to make the issue more coherent. By the way, it is true that this @given example is not very good as it creates a |
You are looking at an intentionally incomplete project. The When and Then steps are present in the scenario: cucumber-java-skeleton/maven/src/test/resources/io/cucumber/skeleton/belly.feature Lines 1 to 6 in d262b8d
And this example project was written using a test driven approach. So just enough code has been written to get the tests running and failing. When run Cucumber will complain about two missing step definitions. You can add those and then incrementally implement the scenario. This is great for people who are learning TDD, but probably less useful as a minimal working example. Please do feel free to workshop a better but still minimal example. |
https://github.com/cucumber/cucumber-java-skeleton/blob/main/gradle/src/test/java/io/cucumber/skeleton/StepDefinitions.java
any test should have assert to make it clear what it is testing
The text was updated successfully, but these errors were encountered: