Empty Steps

29 views
Skip to first unread message

Panayotis Matsinopoulos

unread,
Aug 30, 2016, 3:52:18 PM8/30/16
to Cukes
Dear All,

I have come across with some Scenarios having empty Step implementations.

It makes more sense to use RSpec expectation matchers that evaluate a Ruby block for the implementation of a Scenario. In that case, the firing Step is empty,
and the expectation Step that follows has both the firing logic and the check of the expectation, with the firing logic being given as block to an expect { ... }.to matchers.

How do you feel about this approach? I do not feel comfortable having empty the firing (When) Steps and putting both firing and checking inside the check (Then) Steps.

What is your opinion?

Panos


Knut Petter

unread,
Sep 9, 2016, 5:00:52 PM9/9/16
to Cukes
I've also come across this problem. Although I'm using Cucumber for C++ (cucumber-cpp) with GTEST and GMOCK, your description fits very well.

I think there are three alternatives:
1) Empty steps as you describe
2) Rearrange the wording and the step order
3) Add the firing logic to some sort of a lambda and add it to a list which will be executed right after the expectation in the second (checking) step

Right now I'm doing nr 1), but I'd like to investigate 3. I would prefer not to change the wording or the order due to this.

Regards,
Knut Petter
Reply all
Reply to author
Forward
0 new messages