[RUN AS-IF-FOSS] Enforce RSpec zero monkey patching mode
What does this MR do?
The plan for RSpec 4.0 is to disable monkey patching, reference:
- https://rspec.info/blog/2013/07/the-plan-for-rspec-3/#zero-monkey-patching-mode
- https://relishapp.com/rspec/rspec-core/docs/configuration/zero-monkey-patching-mode
This merge request stops using RSpec monkey patching methods in all the spec files and enforces the zero monkey patching mode. This is the last merge request of the series. After that, it will raise a method missing error because RSpec is not adding the methods to the Object
class, eg:
NoMethodError:
undefined method `describe' for main:Object
It's difficult to review this but a nice way could be to checkout the branch locally and grep filter for changes differences from:
- describe
+ RSpec.describe
- shared_examples
+ RSpec.shared_examples
- shared_context
+ RSpec.shared_context
Something like this:
git diff HEAD^ | grep '^[+-][A-z\w]' | egrep -vE '\-describe|\+RSpec.describe|\-shared_examples|\+RSpec.shared_examples|\-shared_context|\+RSpec.shared_context'
Close #220018 (closed)
Edited by 🤖 GitLab Bot 🤖