mirror of
https://github.com/stretchr/testify.git
synced 2025-05-31 11:42:44 +00:00
Some clarification for the documentation in the example test suite.
This commit is contained in:
parent
cf79884357
commit
c737e6cc4e
@ -71,12 +71,16 @@ func (suite *SuiteTester) NonTestMethod() {
|
|||||||
suite.NonTestMethodRunCount++
|
suite.NonTestMethodRunCount++
|
||||||
}
|
}
|
||||||
|
|
||||||
// Make sure that the Run function runs all of the expected methods
|
// TestRunSuite will be run by the 'go test' command, so within it, we
|
||||||
// within a testing suite.
|
// can run our suite using the Run(*testing.T, TestingSuite) function.
|
||||||
func TestRunSuite(t *testing.T) {
|
func TestRunSuite(t *testing.T) {
|
||||||
suiteTester := new(SuiteTester)
|
suiteTester := new(SuiteTester)
|
||||||
Run(t, suiteTester)
|
Run(t, suiteTester)
|
||||||
|
|
||||||
|
// Normally, the test would end here. The following are simply
|
||||||
|
// some assertions to ensure that the Run function is working as
|
||||||
|
// intended - they are not part of the example.
|
||||||
|
|
||||||
// The suite was only run once, so the SetupSuite and TearDownSuite
|
// The suite was only run once, so the SetupSuite and TearDownSuite
|
||||||
// methods should have each been run only once.
|
// methods should have each been run only once.
|
||||||
assert.Equal(t, suiteTester.SetupSuiteRunCount, 1)
|
assert.Equal(t, suiteTester.SetupSuiteRunCount, 1)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user