Skip to content

Validate RSpec 4 compatibility via disable_monkey_patching!#287

Merged
yahonda merged 1 commit intorsim:masterfrom
yahonda:check-rspec4-compatibility
May 7, 2026
Merged

Validate RSpec 4 compatibility via disable_monkey_patching!#287
yahonda merged 1 commit intorsim:masterfrom
yahonda:check-rspec4-compatibility

Conversation

@yahonda
Copy link
Copy Markdown
Collaborator

@yahonda yahonda commented May 7, 2026

Summary

  • Enable config.disable_monkey_patching! in spec/spec_helper.rb to validate RSpec 4 portability under RSpec 3. RSpec 4 is expected to remove the globally-exposed DSL (top-level describe/context/etc.), equivalent to config.expose_dsl_globally = false, which disable_monkey_patching! flips along with obj.should / obj.stub.
  • Convert the 29 outermost describe "..." calls across spec/plsql/*.rb to RSpec.describe "..." so each spec file loads with the global DSL disabled. Nested describe / context / shared_examples 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.

Test plan

  • bundle exec rspec spec/plsql/version_spec.rb — 1 example, 0 failures (proves spec_helper.rb loads 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 spec against an Oracle DB — pass/fail counts should match master. Any new failure that references RSpec internals (should, stub, exposed DSL) is a real RSpec-4-portability bug to investigate.

🤖 Generated with Claude Code

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>
@yahonda yahonda merged commit d57a0a5 into rsim:master May 7, 2026
20 checks passed
@yahonda yahonda deleted the check-rspec4-compatibility branch May 7, 2026 09:51
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