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 a When() synonym for Context() #348

Closed
decibel opened this issue May 1, 2017 · 3 comments
Closed

Add a When() synonym for Context() #348

decibel opened this issue May 1, 2017 · 3 comments

Comments

@decibel
Copy link

decibel commented May 1, 2017

I find myself writing a lot of Context()s with a description in the form "when ", ... It(). Enough so that I'm wondering if it'd be worth adding a When() to the DSL, something along the lines of:

    return Context("when " + description, ...)
}```

That way if you write:

```When("something happens", func() {
...
})```

you'd get a "when" in the text output as well.
@onsi
Copy link
Owner

onsi commented Jun 3, 2017

Makes sense and should be relatively easy. Will try to get to this soon.

@williammartin
Copy link
Sponsor Collaborator

This was done in #386. Hope it works for you.

@decibel
Copy link
Author

decibel commented Mar 19, 2018

Works great, thanks for your efforts!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants