Skip to content

Commit

Permalink
[mocks] Scrape out monkey patching
Browse files Browse the repository at this point in the history
http://rspec.info/blog/2013/07/the-plan-for-rspec-3/#zero_monkey_patching_mode

> we do want to encourage people to switch to the new syntax, so we plan to make RSpec 3 print a warning on first usage of any the old syntax methods (should, should_not, should_receive, etc) unless the should syntax has been explicitly enabled. This should nudge folks towards the new syntax while keeping RSpec friendly to new users and will pave the way for the old syntax to be disabled by default in RSpec 4.

> zero-monkey-patching mode for RSpec...  We plan for these config options to become the defaults in RSpec 4.0, so that RSpec 4.0 will have zero monkey patching out of the box.

As for "disabled by default" vs "completely removed" and "default, out
of the box" vs "impossible" I can only say that RSpec 4 was probably planned to
be released earlier, as:

> we'll probably be dropping support for 1.8.7 in RSpec 4

but we've also dropped 1.9, 2.0, 2.1 and 2.2

rspec/rspec-core#2301 (comment)

> In RSpec 4, we plan to extract all monkey patching from RSpec and move it into a separate gem, so that monkey patching is opt-in instead of opt-out and users have to explicitly install and load a gem to get it.

`rspec-should` (or `rspec-monkey` as it's also about exposing example
group DSL in the top-level/Module?) will be released later.

Those using the monkey-patched `should` syntax are not encouraged to
update to RSpec 4 until this gem is extracted.

---
This commit was imported from rspec/rspec-mocks@930b8cc.
  • Loading branch information
pirj committed Dec 21, 2020
1 parent 9de4866 commit d639dc7
Show file tree
Hide file tree
Showing 21 changed files with 215 additions and 1,839 deletions.
1 change: 1 addition & 0 deletions rspec-mocks/Changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
Breaking Changes:

* Ruby < 2.3 is no longer supported. (Phil Pirozhkov, #1349)
* Extract monkey-patching `should_receive`/`stub` syntax. (Phil Pirozhkov, #1365)

Bug Fixes:

Expand Down
6 changes: 0 additions & 6 deletions rspec-mocks/features/.nav
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,6 @@
- working_with_legacy_code:
- any_instance.feature
- message_chains.feature
- old_syntax:
- stub.feature
- should_receive.feature
- any_instance.feature
- stub_chain.feature
- unstub.feature
- outside_rspec:
- minitest.feature
- any_test_framework.feature
Expand Down
35 changes: 0 additions & 35 deletions rspec-mocks/features/old_syntax/README.md

This file was deleted.

105 changes: 0 additions & 105 deletions rspec-mocks/features/old_syntax/any_instance.feature

This file was deleted.

92 changes: 0 additions & 92 deletions rspec-mocks/features/old_syntax/should_receive.feature

This file was deleted.

51 changes: 0 additions & 51 deletions rspec-mocks/features/old_syntax/stub.feature

This file was deleted.

69 changes: 0 additions & 69 deletions rspec-mocks/features/old_syntax/stub_chain.feature

This file was deleted.

Loading

0 comments on commit d639dc7

Please sign in to comment.