Repository navigation
Conversation
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
mvz
approved these changes
Oct 16, 2026
mvz
left a comment
Contributor
There was a problem hiding this comment.
LGTM. @luke-hill what do you think?
This branch has not been deployed
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.
Description
Since 12.0.0,
require 'cucumber/rspec/doubles'breaks every scenario in a project using rspec-mocks 3:#1847 removed the rspec-mocks version guard from
lib/cucumber/rspec/doubles.rb, but kept the branch for rspec-mocks older than 2.9.9 (RSpec::Mocks.setup(self)) rather than the current one. rspec-mocks 3.0 removed that argument, so the hook raises on every rspec-mocks 3 release. The same change droppedRSpec::Mocks.verifyfrom theAfterhook, so an unmetexpect(...).to receive(...)would no longer fail the scenario. Neither change is mentioned in the 12.0.0 changelog or upgrading notes, so I take both to be unintended.This restores the hooks the file had for rspec-mocks 3 before 12.0.0 (
setup, thenverifywithteardownin anensure), the same sequencefeatures/lib/support/command_line.rbuses. Nothing in the suite loadedcucumber/rspec/doublesbefore, so this addsfeatures/docs/writing_support_code/rspec_doubles.feature, which checks that a stub works within its scenario, is reset for the next one, and that an unmet expectation fails the scenario. The feature fails against the 12.0.0 file with theArgumentErrorabove.Type of change
Checklist:
bundle exec rubocopreports no offensesRan locally on Ruby 4.0:
rake spec(606 examples, 0 failures),rake cucumber(231 scenarios passed),rake cck(111 examples, 0 failures) andrubocop(no offenses). Also checked against a Rails app's suite of 20 Selenium scenarios that stub withallow(...).to receive.🤖 Generated with Claude Code