-
Notifications
You must be signed in to change notification settings - Fork 61
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
Using Given/When/Then side-by-side with before/it? #47
Comments
In [email protected], this was not encouraged but worked perfectly well because there was no interplay between the given/when/then methods. In 2.x there may be subtle problems depending on what is combined, particularly in cases where a |
Oh, your response beat me to it -- i was just about to close this and repost on the new repo. WIll continue discussing here...
So should the README have a short section such as:
Is that last sentence true? |
I waffle on whether it's worth addressing in that light in the README. :+meh: for now |
Clearly not a huge deal. But I'd lean towards including something like it for two reasons:
|
I think the latter is a compelling point we need to make, but I'm wary of saying it loudly and proudly until we really understand the constraints on the former |
Oh... I thought it was just me who didn't understand :) In that light, yeah I'd agree hold off proclaiming anything that ain't necessarily so. |
I've found that depending on what I'm testing in some cases I might prefer the traditional rspec
context
/it
flow, and in other casesGiven/When/Then
flow. Or I might want to gradually migrate a file full of tests from one to the other, so while in transition the file might have some of each kind.It would be nice if the README could document whether & how it's OK to do something like:
That seems like it would work (and I think it does), but things seems like they'd get messy if there was a
Given
nested inside a context with abefore
or vice versa. (Or maybe there's a well-defined way in which it can work?) Though I imaginebefore(:suite)
hooks wouldn't be a problem.Anyway, WBN for rspec-given to take a firm stand on what's expected to work.
The text was updated successfully, but these errors were encountered: