Closed markbates closed 7 years ago
To add some meat on this proposal, here is a package that implements this proposal:
https://github.com/gobuffalo/suite
Right now it can be used standalone, but if people like it we can add it to the main repo.
I like this idea, i understand the trade-offs buffalo would be making by introducing this but IMHO the wins are larger and will make testing easier/faster while increasing productivity.
Thanks @markbates for sharing this proposal, hoping to see this getting into buffalo soon and willing to help as possible.
Even, I love the idea of including it in Buffalo. It makes it more convenient when you look at Buffalo framework as a whole.
We could always give a flag to not generate the code with default as True.
Lately I've been finding myself using test suites more and more in my applications. I'm wondering if this is something that we should add to Buffalo. While this proposal talks about
ActionSuite
that would be used for testing actions, a similar one,ModelSuite
, would be created for testing models.My typical
ActionSuite
usually looks something like this:Then in my
actions/actions_test.go
file I would create aTest
function that looks something like this:Which means my tests now look like this:
I find this really nice and clean, and means I can add nice setup/teardown to my tests.
So the question is should this be included in Buffalo or should I release this as a separate package that people can use if they desire?
Included in Buffalo Pros/Cons:
Pros
testify
is already being depended on by Buffalo, so there's no extra dependencyCons
Separate Package Pros/Cons:
Pros
Cons
I'm looking for thoughts/opinions on this.