Skip to content

Commit 680a5aa

Browse files
Abseil Teamderekmauro
authored andcommitted
Googletest export
Move matchers reference from cheat sheet into its own document PiperOrigin-RevId: 370749693
1 parent 719fd2d commit 680a5aa

File tree

6 files changed

+301
-300
lines changed

6 files changed

+301
-300
lines changed

docs/_data/navigation.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@ nav:
2121
url: "/gmock_cheat_sheet.html"
2222
- section: "References"
2323
items:
24+
- title: "Matchers"
25+
url: "/reference/matchers.html"
2426
- title: "Testing FAQ"
2527
url: "/faq.html"
2628
- title: "Mocking FAQ"

docs/advanced.md

Lines changed: 8 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -364,11 +364,9 @@ Verifies that `val1` is less than, or almost equal to, `val2`. You can replace
364364
365365
### Asserting Using gMock Matchers
366366
367-
[gMock](gmock_for_dummies.md) comes with
368-
[a library of matchers](gmock_cheat_sheet.md#MatcherList) for
369-
validating arguments passed to mock objects. A gMock *matcher* is basically a
370-
predicate that knows how to describe itself. It can be used in these assertion
371-
macros:
367+
gMock comes with a library of *matchers* for validating arguments passed to mock
368+
objects. A gMock matcher is basically a predicate that knows how to describe
369+
itself. It can be used in these assertion macros:
372370
373371
374372
| Fatal assertion | Nonfatal assertion | Verifies |
@@ -386,14 +384,11 @@ using ::testing::StartsWith;
386384
EXPECT_THAT(Foo(), StartsWith("Hello"));
387385
```
388386

389-
Read this
390-
[recipe](gmock_cook_book.md#using-matchers-in-googletest-assertions)
391-
in the gMock Cookbook for more details.
392-
393-
gMock has a rich set of matchers. You can do many things googletest cannot do
394-
alone with them. For a list of matchers gMock provides, read
395-
[this](gmock_cook_book.md##using-matchers). It's easy to write
396-
your [own matchers](gmock_cook_book.md#NewMatchers) too.
387+
See
388+
[Using Matchers in googletest Assertions](gmock_cook_book.md#using-matchers-in-googletest-assertions)
389+
in the gMock Cookbook for more details. For a list of built-in matchers, see the
390+
[Matchers Reference](reference/matchers.md). You can also write your own
391+
matchers—see [Writing New Matchers Quickly](gmock_cook_book.md#NewMatchers).
397392

398393
gMock is bundled with googletest, so you don't need to add any build dependency
399394
in order to take advantage of this. Just include `"gmock/gmock.h"`

0 commit comments

Comments
 (0)