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++
|
||||
}
|
||||
|
||||
// Make sure that the Run function runs all of the expected methods
|
||||
// within a testing suite.
|
||||
// TestRunSuite will be run by the 'go test' command, so within it, we
|
||||
// can run our suite using the Run(*testing.T, TestingSuite) function.
|
||||
func TestRunSuite(t *testing.T) {
|
||||
suiteTester := new(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
|
||||
// methods should have each been run only once.
|
||||
assert.Equal(t, suiteTester.SetupSuiteRunCount, 1)
|
||||
|
Loading…
x
Reference in New Issue
Block a user