From c737e6cc4e609beaa68ad05adcf02bca53d1a942 Mon Sep 17 00:00:00 2001 From: Samuel Nelson Date: Tue, 15 Oct 2013 11:56:36 -0600 Subject: [PATCH] Some clarification for the documentation in the example test suite. --- suite/suite_test.go | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/suite/suite_test.go b/suite/suite_test.go index 05e0163..41630df 100644 --- a/suite/suite_test.go +++ b/suite/suite_test.go @@ -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)