Didn't find this issue recorded as I found it, but I'd receive test failures like this:
allow(something).to receive(:a_method).with(/something/, anything)
ArgumentError:
wrong number of arguments (given 2, expected 0)
This struck me as weird because with should receive any number of args. Using byebug to check the source and source_location of the with method, I found that it had been overridden by ActiveSupport. Updating my Gemfile to use the main branch as recommended on another issue fixed this:
%w[rspec-core rspec-expectations rspec-mocks rspec-rails rspec-support].each do |lib|
gem lib, git: "https://github.com/rspec/#{lib}.git", branch: 'main'
end
Didn't find this issue recorded as I found it, but I'd receive test failures like this:
This struck me as weird because
with
should receive any number of args. Usingbyebug
to check thesource
andsource_location
of thewith
method, I found that it had been overridden by ActiveSupport. Updating my Gemfile to use themain
branch as recommended on another issue fixed this: