-
Notifications
You must be signed in to change notification settings - Fork 69
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
How to write a Scenario without using tables #192
Comments
Write the result in the step file. The step can be: Then the result matrix is correctly computed Then in the step file step "the result matrix is correctly computed" do
expect(result).to eq(result_matrix)
end |
Ok, but if do this, I think the writen scenario is not readable enough.Correct me if I'm wrong, but I thougth the whole point of writing the scenarios in gherkin for acceptance tests was to allow anyone, even a customer, to read and understand the tests. |
My own understanding is you need a different mindset when determining what is a good "reads and understands" test. I would write this test as (while I have no idea what Taguchi array is): Feature: Generated matrix is an L8 Taguchi array
As a role,
In order to accomplish something
I want to be able to have a correct algorithm on generating Taguchi array
Scenario: Happy Path
Given a reasonable input
When I invoke the algorithm
Then the algorithm outputs the desired result
Scenario: N is out of bound
Given N is out of bound
And other params are within normal range
When I invoke the algorithm
Then the algorithm handles N out of bound the error Look at your original test, it does say what happens but it doesn't really say the intention of the tests, does it? I would argue the steps like But this is just my opinion. In any case, when using spinach there is no way to write tests with such dynamic steps. If you feel strongly about to have these capacities you may also want to look into https://github.com/jnicklas/turnip |
I guess you have a point there. Thanks a lot by the way |
I was writing my test in Cucumber, but decided to move to Spinach. I had this scenario in my previous Cucumber tests:
Scenario: Test if a generated matrix is in fact, an L8 Taguchi array
Given the number of levels Q is 2
And N is 7
And J is 3
Then the resulting matrix should be:
I know you do not support tables, but how then can I input my arrays ?
The text was updated successfully, but these errors were encountered: