corbym / gogiven Goto Github PK
View Code? Open in Web Editor NEWgogiven - BDD testing framework for go that generates readable output directly from source code
License: BSD 3-Clause "New" or "Revised" License
gogiven - BDD testing framework for go that generates readable output directly from source code
License: BSD 3-Clause "New" or "Revised" License
As a user, I want to be able to view an index of test data generated by the framework, so that I can find a test easily.
I especially want to be able to easily navigate to failed tests, and want them indexed in a way that preserves information about the package the test was in.
...
//This comment should appear as notes next to the test output.
func TestMyTest(t *testing.T){
Given(someFoo).
When(somethingHappens).
Then(...){
//assertions go here
}
}
should display as:
Specification
This comment should appear as notes next to the test output
Given some foo
When something happens
Then
noting that assertions go here
The test comment is not rendered.
As a developer, I want to be able to get information from my currently running test state, so that I have up to the minute information about the build.
Implementation detail: the test should be able to report to some channel or feed the current state of the test.
As a developer, I would prefer not to have to chain the given/when/then functions so that I can space the code out better.
Example:
Given(testing, clockParametersUnder(test)).
When(func(capturedIO testdata.CapturedIO, givens testdata.InterestingGivens) {
clock, err = berlinclock.Clock(test.time)
}).
Then(func(testingT base.TestingT, actual testdata.CapturedIO, givens testdata.InterestingGivens) {
then.AssertThat(testing, err, is.Nil())
then.AssertThat(testing, clock, is.
EqualTo(test.expected).
Reasonf("time incorrect for %s", test.time))
})
should be more like this:
func TestMyTest(testing *testing.T) {
Given(testing, clockParametersUnder(test))
When(func(capturedIO testdata.CapturedIO, givens testdata.InterestingGivens) {
clock, err = berlinclock.Clock(test.time)
})
Then(func(testingT base.TestingT, actual testdata.CapturedIO, givens testdata.InterestingGivens) {
then.AssertThat(testing, err, is.Nil())
then.AssertThat(testing, clock, is.
EqualTo(test.expected).
Reasonf("time incorrect for %s", test.time))
})
}
Output should look and feel like godoc.
Looks old and in need of updating.
As a developer, I want better formatted Given/When/Then output so that the consumers of my test can understand the test more easily.
As a developer, I want to be able to inline variables I pass to my functions in a formatted way, so that my tests are more understandable.
Example:
func TestMyStuff(testing testing.T){
Given(iAmMaking_CupsOf_Tea(3, "Earl Grey")).
When(iPour_MillilitersOfWater("250")).
Then(func(...){
// some assertions
}
}
.. should render as:
Given I am making 3 cups of Earl Grey Tea
When I pour 250 milliliters of water
Then
// some assertions
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.