Skip to content

RSpec: disable monkey patching - #20

Merged
olleolleolle merged 1 commit into
masterfrom
rspec-zero-monkey-patching
Nov 16, 2026
Merged

olleolleolle merged 1 commit into
masterfrom
rspec-zero-monkey-patching

Conversation

@olleolleolle

Copy link
Copy Markdown
Contributor

Why

By default, RSpec adds describe (and friends) to the top-level object and to Module, so specs can call describe without the RSpec. prefix. RSpec's "zero monkey patching mode" turns that off, so RSpec doesn't modify core Ruby classes while the specs run. It's the recommended setup in the generated spec_helper.rb, and RSpec 4 is expected to make it the default.

What changed

  • spec/spec_helper.rb calls config.disable_monkey_patching!.
  • The top-level describe in each of the eight spec files is now RSpec.describe. Each file already had only one.

The specs only use the expect syntax, so nothing else needed to change.

How it was verified

  • bundle exec rake: 34 + 4 examples, 0 failures.

Risk

None for users of the gem: only spec files change.

@olleolleolle
olleolleolle merged commit cefbf5d into master Nov 16, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant