Validate RSpec 4 compatibility via disable_monkey_patching!#287
Merged
yahonda merged 1 commit intorsim:masterfrom May 7, 2026
Merged
Validate RSpec 4 compatibility via disable_monkey_patching!#287yahonda merged 1 commit intorsim:masterfrom
yahonda merged 1 commit intorsim:masterfrom
Conversation
RSpec 4 is expected to remove the globally-exposed DSL (top-level describe/context/etc.), equivalent to RSpec 3's config.expose_dsl_globally = false. Enabling config.disable_monkey_patching! now under RSpec 3 lets us see whether the suite is portable to RSpec 4. Set config.disable_monkey_patching! in spec/spec_helper.rb. With the global DSL disabled, every spec file's outermost describe must be qualified, so convert the 29 top-level describe calls across spec/plsql/*.rb to RSpec.describe. Nested describe/context/ shared_examples calls are unaffected. The suite already uses expect(...).to and allow(...).to receive(...) syntax, so the expect_with / mock_with portions of disable_monkey_patching! are no-ops here. bundle exec rspec spec --dry-run reports 461 examples, 0 failures, confirming every spec file loads under the new configuration. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
config.disable_monkey_patching!inspec/spec_helper.rbto validate RSpec 4 portability under RSpec 3. RSpec 4 is expected to remove the globally-exposed DSL (top-leveldescribe/context/etc.), equivalent toconfig.expose_dsl_globally = false, whichdisable_monkey_patching!flips along withobj.should/obj.stub.describe "..."calls acrossspec/plsql/*.rbtoRSpec.describe "..."so each spec file loads with the global DSL disabled. Nesteddescribe/context/shared_examplesare unaffected.expect(...).toandallow(...).to receive(...)syntax, so theexpect_with/mock_withportions ofdisable_monkey_patching!are no-ops here.Test plan
bundle exec rspec spec/plsql/version_spec.rb— 1 example, 0 failures (provesspec_helper.rbloads with the new flag).bundle exec rspec spec --dry-run— 461 examples, 0 failures (every spec file registers cleanly with the global DSL disabled).bundle exec rspec specagainst an Oracle DB — pass/fail counts should matchmaster. Any new failure that references RSpec internals (should,stub, exposed DSL) is a real RSpec-4-portability bug to investigate.🤖 Generated with Claude Code