Some clarification for the documentation in the example test suite.

This commit is contained in:
Samuel Nelson 2013-10-15 11:56:36 -06:00
parent cf79884357
commit c737e6cc4e

View File

@ -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)