-
Notifications
You must be signed in to change notification settings - Fork 4
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
add define_step and steps and calculate steps prefix length dynamically #7
Conversation
# def ButThen(msg, &block) | ||
# step(" But Then #{msg}", &block) | ||
# end | ||
define_step(*%w[Given When Then And But]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💯
if | ||
msg.is_a? Array | ||
then | ||
prefix, text = msg |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is there a case where msg
would not be an array? maybe we should just have it as:
example.metadata[:bdd_step_messages].map do |prefix, text|
and we get rid of the extra if
that clutters the code :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no, msg will always be an Array, originally the code was longer and the prefix did not come with the msg.
Now, always array.
92c0c81
to
2c07ab3
Compare
@@ -81,4 +81,7 @@ def run_test(name) | |||
expect(@test.failures.count).to eq(1) | |||
end | |||
|
|||
def uncolorize(text) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wonder if this should go to Bdd::Colors
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't wonder, it should 👍
# def ButThen(msg, &block) | ||
# step(" But Then #{msg}", &block) | ||
# end | ||
define_bdd_step(*%w[Given When Then And But]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💯
And("a condition Y") {} | ||
And("a condition Y") { | ||
Then("overwrite happened") { | ||
But("it did nothing") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this was showing SKIPPED
without indentation after a condition Y
- it's fixed now :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
a bit more magic :D