summaryrefslogtreecommitdiff
path: root/doc/development/gotchas.md
diff options
context:
space:
mode:
authorLin Jen-Shin <godfat@godfat.org>2018-12-03 21:12:53 +0800
committerLin Jen-Shin <godfat@godfat.org>2018-12-03 21:18:59 +0800
commitb8a6d57bc84e6ef27468d80fdcf415139f67831e (patch)
tree0ac8d27473e4c48e766bfe13c6357880fb4f261e /doc/development/gotchas.md
parent9eb18d16bd15c0ecb5d1d50c09c150238530b0ab (diff)
downloadgitlab-ce-b8a6d57bc84e6ef27468d80fdcf415139f67831e.tar.gz
Make docs about expect_next_instance_of consistent
So we compare `expect_any_instance_of` with `expect_next_instance_of`, but still mention `allow_any_instance_of`.
Diffstat (limited to 'doc/development/gotchas.md')
-rw-r--r--doc/development/gotchas.md6
1 files changed, 3 insertions, 3 deletions
diff --git a/doc/development/gotchas.md b/doc/development/gotchas.md
index 84dea7ce9aa..a5a34d82bec 100644
--- a/doc/development/gotchas.md
+++ b/doc/development/gotchas.md
@@ -92,7 +92,7 @@ describe API::Labels do
end
```
-## Avoid using `allow_any_instance_of` in RSpec
+## Avoid using `expect_any_instance_of` or `allow_any_instance_of` in RSpec
### Why
@@ -102,7 +102,7 @@ end
error like this:
```
- 1.1) Failure/Error: allow_any_instance_of(ApplicationSetting).to receive_messages(messages)
+ 1.1) Failure/Error: expect_any_instance_of(ApplicationSetting).to receive_messages(messages)
Using `any_instance` to stub a method (elasticsearch_indexing) that has been defined on a prepended module (EE::ApplicationSetting) is not supported.
```
@@ -112,7 +112,7 @@ Instead of writing:
```ruby
# Don't do this:
-allow_any_instance_of(Project).to receive(:add_import_job)
+expect_any_instance_of(Project).to receive(:add_import_job)
```
We could write: