-
Notifications
You must be signed in to change notification settings - Fork 554
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
Request for feedback - GoConvey DSL v2.0 #121
Comments
+1 for option 1 |
|
@rmetzler - Good point, I'm still not sold on the name of the new struct either. In the case of
|
Option 1 |
I’m leaning towards Option 2. |
Moving forward with option 2. Personally, I don't like having to see |
I was just about to pull the trigger for v2.0 with option 2 when "lightning struck my brain" (didn't even hurt). Try this on for size: Suite(t, func(convey C, so So, reset R, focus Focus, skip S) {
convey("nested 1", nil)
focus("EXCLUSIVE!!", func() {
convey("special stuff", nil)
})
skip("something else", func() {
so(1, ShouldEqual, 1)
})
reset(func() {
})
}) I know what you're thinking: "What!? Why do I have to pass in 4 arguments in the top-level Finally, did you notice the I'd like to take some time tomorrow or Thursday to get your feedback and kick this around. |
That. Would. Be. Awesome. It is getting complicated quickly, though. Is the top-level Convey always going to be "Suite"? Can it stay "Convey" for simplicity? |
Yes, it could (and it's probably still better that way). I couldn't tell what would be more confusing, having uppercase func TestFeatureUnderDevelopment(t *testing.T) {
Convey(t, func(c Context) {
c.Convey("nested something", nil)
c.Focus("EXCLUSIVE", func() {
c.Convey("special stuff", nil)
})
c.Skipconvey("something else", func() {
c.So(1, ShouldEqual, 1)
})
// usually needed only for integration tests
c.Reset(func() {
})
})
} If that |
Personally, I'm not liking the Another thought: what about, instead of |
I see your point and I feel the same way. I'm wondering about giving people with other sensibilities a choice. I'm also thinking of changing SkipConvey to just Skip so Focus (or Only) would be a standalone term then too. I've got ideas flying around like crazy. Nothing is settled yet. |
I've opened this issue as a way to talk about how the syntax of the DSL might be altered to provide solutions for some of our long-standing, known issues. Please provide feedback/ideas in the comments.
I'm going to present the two options I'm considering below. Feel free to vote for either or present your own. The goal with these changes is to eliminate all package-level state from GoConvey so that test functions can be run in parallel. In the two options below this is accomplished with a sort of Context object which I'm calling
C
. This object will house its own runner and a reporter (which are now package level resources). I've prototyped option 2 on the concurrency branch of this project.Option 1:
Option 2:
The text was updated successfully, but these errors were encountered: