Things are working great with Cucumber and am getting better at
expressing requirements as behaviors. Kudos!
I seek a couple of points of clarification, or confirmation, if
someone has a minute or two…
FWIW - I’ve read the wiki and the given-when-then page and just seek
confirmation:
There is no dependency implied in the keywords “given”, “then” and
“when” (as well as “and” and "but), correct? These are simply naming
conventions that denote the well known “Build/Operate/Check” pattern
but have no real physical relationship, they’re just tags that denote
the steps.
A “pending” step is any step that has a matching step but nothing is
implemented.
A “successful” step is any step that is matched, has some code and
doesn’t assert anything resolving to false.
A “gray” out step means that no steps were found that matched the
feature.
You need to be careful that features do not match steps in the step
file or cucumber will execute the first step it finds that matches
(really don’t know how this works, will a test sequence ever go
‘backwards’?)
Going back and changing the stuff in the .feature file is risky as
it’s very easy to create a mismatch and the step won’t be found.
Thank you David. This helps a lot. Question, if there are matching
steps…will cucumber find the first matching step during execution? I
noticed a test executing at higher line numbers and then picking up a
step with a lower line number.
There is no dependency implied in the keywords “given”, “then” and
“when” (as well as “and” and "but), correct? These are simply naming
conventions that denote the well known “Build/Operate/Check” pattern
but have no real physical relationship, they’re just tags that denote
the steps.
Correct.
A “pending” step is any step that has a matching step but nothing is
implemented.
Correct.
A “successful” step is any step that is matched, has some code and
doesn’t assert anything resolving to false.
Or raise an error.
A “gray” out step means that no steps were found that matched the feature.
Blue? Means that a step was found, but a previous step was either
pending or failed.
You need to be careful that features do not match steps in the step
file or cucumber will execute the first step it finds that matches
(really don’t know how this works, will a test sequence ever go
‘backwards’?)
Cucumber tells you when it finds two steps definitions that could
match the step in the feature.
Going back and changing the stuff in the .feature file is risky as
it’s very easy to create a mismatch and the step won’t be found.
Not sure why that is risky, unless you mean that there are
non-developers making these changes. If so, then they should probably
be made collaboratively.
Thank you David. This helps a lot. Question, if there are matching
steps…will cucumber find the first matching step during execution? I
noticed a test executing at higher line numbers and then picking up a
step with a lower line number.
Again, cucumber looks at all of the steps and throws an error if more
than one will match your step. So order should not be an issue.
A “pending” step is any step that has a matching step but nothing is
implemented.
Correct.
A “pending” step (plain text) is any step that does not have a
matching
step definition (regexp+proc).
-Or (as of 0.1.13) a matching step definition that raises Pending (for
example by calling #pending).
pending or failed.
it’s very easy to create a mismatch and the step won’t be found.
Not sure why that is risky, unless you mean that there are
non-developers making these changes. If so, then they should probably
be made collaboratively.
Every time something is changed, you run Cucumber immediately, and then
you’ll know if you broke something.
FWIW - I’ve read the wiki and the given-when-then page and just seek
A “pending” step is any step that has a matching step but nothing is
implemented.
Correct.
In the latest version in Github (0.1.13) you can also force steps which
have an implementation to the pending state using the ‘pending’ method
which works in the same way as Rspec’s pending.
When “I want to be lazy” do
pending “Implement me!”
end