Skip to content

Commit feb1324

Browse files
Merge pull request #1714 from brackendawson/doc-inline-code
doc: remove ineffective inline code blocks
2 parents 49bcd2a + 5a4a1cc commit feb1324

File tree

9 files changed

+56
-52
lines changed

9 files changed

+56
-52
lines changed

assert/assertion_format.go

Lines changed: 5 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

assert/assertion_forward.go

Lines changed: 10 additions & 10 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

assert/assertions.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1632,7 +1632,7 @@ func InEpsilonSlice(t TestingT, expected, actual interface{}, epsilon float64, m
16321632
Errors
16331633
*/
16341634

1635-
// NoError asserts that a function returned no error (i.e. `nil`).
1635+
// NoError asserts that a function returned a nil error (ie. no error).
16361636
//
16371637
// actualObj, err := SomeFunction()
16381638
// if assert.NoError(t, err) {
@@ -1649,7 +1649,7 @@ func NoError(t TestingT, err error, msgAndArgs ...interface{}) bool {
16491649
return true
16501650
}
16511651

1652-
// Error asserts that a function returned an error (i.e. not `nil`).
1652+
// Error asserts that a function returned a non-nil error (ie. an error).
16531653
//
16541654
// actualObj, err := SomeFunction()
16551655
// assert.Error(t, err)
@@ -1664,7 +1664,7 @@ func Error(t TestingT, err error, msgAndArgs ...interface{}) bool {
16641664
return true
16651665
}
16661666

1667-
// EqualError asserts that a function returned an error (i.e. not `nil`)
1667+
// EqualError asserts that a function returned a non-nil error (i.e. an error)
16681668
// and that it is equal to the provided error.
16691669
//
16701670
// actualObj, err := SomeFunction()
@@ -1687,8 +1687,8 @@ func EqualError(t TestingT, theError error, errString string, msgAndArgs ...inte
16871687
return true
16881688
}
16891689

1690-
// ErrorContains asserts that a function returned an error (i.e. not `nil`)
1691-
// and that the error contains the specified substring.
1690+
// ErrorContains asserts that a function returned a non-nil error (i.e. an
1691+
// error) and that the error contains the specified substring.
16921692
//
16931693
// actualObj, err := SomeFunction()
16941694
// assert.ErrorContains(t, err, expectedErrorSubString)

assert/doc.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,8 @@
4040
//
4141
// # Assertions
4242
//
43-
// Assertions allow you to easily write test code, and are global funcs in the `assert` package.
44-
// All assertion functions take, as the first argument, the `*testing.T` object provided by the
43+
// Assertions allow you to easily write test code, and are global funcs in the assert package.
44+
// All assertion functions take, as the first argument, the [*testing.T] object provided by the
4545
// testing framework. This allows the assertion funcs to write the failings and other details to
4646
// the correct place.
4747
//

mock/mock.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -712,8 +712,8 @@ func (m *Mock) AssertNotCalled(t TestingT, methodName string, arguments ...inter
712712
return true
713713
}
714714

715-
// IsMethodCallable checking that the method can be called
716-
// If the method was called more than `Repeatability` return false
715+
// IsMethodCallable returns true if given methodName and arguments have an
716+
// unsatisfied expected call registered in the Mock.
717717
func (m *Mock) IsMethodCallable(t TestingT, methodName string, arguments ...interface{}) bool {
718718
if h, ok := t.(tHelper); ok {
719719
h.Helper()

require/doc.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Package require implements the same assertions as the `assert` package but
1+
// Package require implements the same assertions as the assert package but
22
// stops test execution when a test fails.
33
//
44
// # Example Usage
@@ -21,8 +21,8 @@
2121
//
2222
// # Assertions
2323
//
24-
// The `require` package have same global functions as in the `assert` package,
25-
// but instead of returning a boolean result they call `t.FailNow()`.
24+
// The require package have same global functions as in the assert package,
25+
// but instead of returning a boolean result they call [testing.T.FailNow].
2626
// A consequence of this is that it must be called from the goroutine running
2727
// the test function, not from other goroutines created during the test.
2828
//

require/require.go

Lines changed: 10 additions & 10 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

require/require_forward.go

Lines changed: 10 additions & 10 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

suite/suite.go

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -63,11 +63,15 @@ func (suite *Suite) Require() *require.Assertions {
6363
return suite.require
6464
}
6565

66-
// Assert returns an assert context for suite. Normally, you can call
67-
// `suite.NoError(expected, actual)`, but for situations where the embedded
68-
// methods are overridden (for example, you might want to override
69-
// assert.Assertions with require.Assertions), this method is provided so you
70-
// can call `suite.Assert().NoError()`.
66+
// Assert returns an assert context for suite. Normally, you can call:
67+
//
68+
// suite.NoError(err)
69+
//
70+
// But for situations where the embedded methods are overridden (for example,
71+
// you might want to override assert.Assertions with require.Assertions), this
72+
// method is provided so you can call:
73+
//
74+
// suite.Assert().NoError(err)
7175
func (suite *Suite) Assert() *assert.Assertions {
7276
suite.mu.Lock()
7377
defer suite.mu.Unlock()

0 commit comments

Comments
 (0)