diff options
author | Sam Sobell <sam.sobell@gmail.com> | 2019-07-10 14:37:57 (GMT) |
---|---|---|
committer | Derek Mauro <761129+derekmauro@users.noreply.github.com> | 2019-07-10 14:37:57 (GMT) |
commit | ee3aa831172090fd5442820f215cb04ab6062756 (patch) | |
tree | b61d657dda5d9b3cb533cd54f7ced5286a6a652f /googlemock | |
parent | 437e1008c97b6bf595fec85da42c6925babd96b2 (diff) | |
download | googletest-ee3aa831172090fd5442820f215cb04ab6062756.zip googletest-ee3aa831172090fd5442820f215cb04ab6062756.tar.gz googletest-ee3aa831172090fd5442820f215cb04ab6062756.tar.bz2 |
Fix bad advice in cook book (#2308)
This line directly contradicts the warning that google mock spits out on unused mock calls:
```
NOTE: You can safely ignore the above warning unless this call should not happen. Do not suppress it by blindly adding an EXPECT_CALL() if you don't mean to enforce the call. See https://github.com/google/googletest/blob/master/googlemock/docs/CookBook.md#knowing-when-to-expect for details.
```
One or the other should be changed, and I believe the advice in this file is incorrect.
Diffstat (limited to 'googlemock')
-rw-r--r-- | googlemock/docs/cook_book.md | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/googlemock/docs/cook_book.md b/googlemock/docs/cook_book.md index 6b0228a..8f26a83 100644 --- a/googlemock/docs/cook_book.md +++ b/googlemock/docs/cook_book.md @@ -229,7 +229,7 @@ If a mock method has no `EXPECT_CALL` spec but is called, Google Mock will print a warning about the "uninteresting call". The rationale is: * New methods may be added to an interface after a test is written. We shouldn't fail a test just because a method it doesn't know about is called. - * However, this may also mean there's a bug in the test, so Google Mock shouldn't be silent either. If the user believes these calls are harmless, they can add an `EXPECT_CALL()` to suppress the warning. + * However, this may also mean there's a bug in the test, so Google Mock shouldn't be silent either. (Note that the user should [*not* add an `EXPECT_CALL()`](https://github.com/google/googletest/blob/master/googlemock/docs/CookBook.md#knowing-when-to-expect) to suppress the warning, even if they think the call is harmless). However, sometimes you may want to suppress all "uninteresting call" warnings, while sometimes you may want the opposite, i.e. to treat all |