Skip to content
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

Merged
merged 11 commits into from
May 19, 2016

Conversation

mpapis
Copy link
Collaborator

@mpapis mpapis commented May 16, 2016

a bit more magic :D

# def ButThen(msg, &block)
# step(" But Then #{msg}", &block)
# end
define_step(*%w[Given When Then And But])
Copy link
Owner

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
Copy link
Collaborator Author

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 :)

Copy link
Owner

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.

@mpapis mpapis force-pushed the feature/improved_formating branch from 92c0c81 to 2c07ab3 Compare May 18, 2016 14:08
@@ -81,4 +81,7 @@ def run_test(name)
expect(@test.failures.count).to eq(1)
end

def uncolorize(text)
Copy link
Collaborator Author

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?

Copy link
Owner

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 👍

@ch1ago ch1ago mentioned this pull request May 19, 2016
# def ButThen(msg, &block)
# step(" But Then #{msg}", &block)
# end
define_bdd_step(*%w[Given When Then And But])
Copy link
Owner

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")
Copy link
Collaborator Author

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 :)

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@ch1ago ch1ago merged commit 30f4a7a into master May 19, 2016
@ch1ago ch1ago deleted the feature/improved_formating branch May 19, 2016 22:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants