Repository navigation
feat: Add support for rspec 4 - #128
Merged
Merged
Conversation
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues block approval of the RSpec 4 compatibility changes.
No open issues 🎉
What changed in this PR
Adds RSpec 4 compatibility to the GitHub Actions formatter while retaining RSpec 3 support, with separate dependency bundles and CI coverage for both versions.
Changes:
- Broadens the
rspec-coredependency range to allow versions 3 and 4. - Adds locked RSpec 3 and RSpec 4 bundles and tests both in CI, excluding Ruby 3.1 with the locked RSpec 4 dependencies.
- Updates test configuration to avoid options removed in RSpec 4.
| File | Description |
|---|---|
spec/spec_helper.rb |
Guards RSpec 3-only configuration settings. |
rspec-github.gemspec |
Allows rspec-core versions from 3.0 up to, but excluding, 5. |
gemfiles/rspec4.gemfile.lock |
Locks the RSpec 4 beta dependency bundle. |
gemfiles/rspec4.gemfile |
Defines the RSpec 4 test bundle. |
gemfiles/rspec3.gemfile.lock |
Locks the RSpec 3 dependency bundle. |
gemfiles/rspec3.gemfile |
Defines the RSpec 3 test bundle. |
Gemfile.lock |
Reflects the expanded runtime dependency constraint. |
.rspec |
Removes the unsupported --color option. |
.github/workflows/ci.yml |
Runs unit and end-to-end jobs against both RSpec bundles. |
Review effort: Balanced
LuukvH
force-pushed
the
claude/rspec-4-support
branch
from
November 16, 2026 11:15
f1020fe to
361be59
Compare
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.
Stacked on #127 (requires ruby >= 3.3), which should be merged first.
Adds support for RSpec 4. I checked against rspec-core 4.0.0.beta1 (released 2026-02-18), which is the newest RSpec 4 release on rubygems.org. There is no stable 4.x yet.
What changed in RSpec 4 that matters here
RSpec::Core::Formatters.register,BaseFormatter,FailedExampleNotification/SkippedExampleNotification(message_lines,example), andSeedNotification(seed_used?,fully_formatted).PendingExampleFixedNotificationandPendingExampleFailedAsExpectedNotificationclasses were removed. This formatter never referenced them.--color,disable_monkey_patching!and theshouldsyntax (expectations.syntax=) were removed. Only this repo's own test setup used them.The annotations produced for
spec/integration/failing_spec.rbare identical on RSpec 3.13.7 and 4.0.0.beta1.Changes
rspec-core'~> 3.0'→'>= 3.0', '< 5'gemfiles/rspec3.gemfileandgemfiles/rspec4.gemfilewith lockfiles, following the approach from Add support RSpec 4.0.0.beta1 #115.rspecjob (Ruby 3.3, 3.4 and 4.0, from chore: Require ruby 3.3 or newer and test on ruby 4.0 #127) and thee2ejob now run against both gemfiles viaBUNDLE_GEMFILE. No action versions changed, soactions.lockneeds no update.spec_helper.rb: only calldisable_monkey_patching!/syntax = :expectwhen they exist, which is RSpec 3 only..rspec: dropped--color, which RSpec 4 removed. Colour is still enabled automatically on a TTY.