diff options
author | Krystian Kuzniarek <krystian.kuzniarek@gmail.com> | 2019-07-13 07:47:14 +0200 |
---|---|---|
committer | Krystian Kuzniarek <krystian.kuzniarek@gmail.com> | 2019-07-13 07:47:14 +0200 |
commit | 275bbc7884e9a12e9d9a46a95d5e1757c91d6313 (patch) | |
tree | b23c7abbf6c0df0924d31689c07745f79354e6b2 /googlemock/docs/ForDummies.md | |
parent | 437e1008c97b6bf595fec85da42c6925babd96b2 (diff) | |
download | googletest-275bbc7884e9a12e9d9a46a95d5e1757c91d6313.tar.gz googletest-275bbc7884e9a12e9d9a46a95d5e1757c91d6313.zip |
rename and apply snake_case on CheatSheet.md
Diffstat (limited to 'googlemock/docs/ForDummies.md')
-rw-r--r-- | googlemock/docs/ForDummies.md | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/googlemock/docs/ForDummies.md b/googlemock/docs/ForDummies.md index c8a83cba..4b7551e9 100644 --- a/googlemock/docs/ForDummies.md +++ b/googlemock/docs/ForDummies.md @@ -249,7 +249,7 @@ EXPECT_CALL(turtle, Forward(_)); `_` is an instance of what we call **matchers**. A matcher is like a predicate and can test whether an argument is what we'd expect. You can use a matcher inside `EXPECT_CALL()` wherever a function argument is expected. -A list of built-in matchers can be found in the [CheatSheet](CheatSheet.md). For example, here's the `Ge` (greater than or equal) matcher: +A list of built-in matchers can be found in the [CheatSheet](cheat_sheet.md). For example, here's the `Ge` (greater than or equal) matcher: ```cpp using ::testing::Ge; @@ -264,7 +264,7 @@ The first clause we can specify following an `EXPECT_CALL()` is `Times()`. We ca An interesting special case is when we say `Times(0)`. You may have guessed - it means that the function shouldn't be called with the given arguments at all, and Google Mock will report a Google Test failure whenever the function is (wrongfully) called. -We've seen `AtLeast(n)` as an example of fuzzy cardinalities earlier. For the list of built-in cardinalities you can use, see the [CheatSheet](CheatSheet.md). +We've seen `AtLeast(n)` as an example of fuzzy cardinalities earlier. For the list of built-in cardinalities you can use, see the [CheatSheet](cheat_sheet.md). The `Times()` clause can be omitted. **If you omit `Times()`, Google Mock will infer the cardinality for you.** The rules are easy to remember: @@ -305,7 +305,7 @@ says that `turtle.GetY()` will be called _at least twice_ (Google Mock knows thi Of course, if you explicitly write a `Times()`, Google Mock will not try to infer the cardinality itself. What if the number you specified is larger than there are `WillOnce()` clauses? Well, after all `WillOnce()`s are used up, Google Mock will do the _default_ action for the function every time (unless, of course, you have a `WillRepeatedly()`.). -What can we do inside `WillOnce()` besides `Return()`? You can return a reference using `ReturnRef(variable)`, or invoke a pre-defined function, among [others](CheatSheet.md#actions). +What can we do inside `WillOnce()` besides `Return()`? You can return a reference using `ReturnRef(variable)`, or invoke a pre-defined function, among [others](cheat_sheet.md#actions). **Important note:** The `EXPECT_CALL()` statement evaluates the action clause only once, even though the action may be performed many times. Therefore you must be careful about side effects. The following may not do what you want: |