ArrayIncludingMatcher raises a NoMethodError for non-array objects
Created by: papa-cool
A NoMethodError
is raised when we compare a non-array object with an ArrayIncludingMatcher
instance.
it "succeeds" do
expect([[1,2]]).to match array_including(array_including(1,2))
end
it "raises error instead of succeed" do
expect([1,[1,2]]).to match array_including(1, array_including(1,2))
end
it "raises error instead of fail" do
expect([1]).to match array_including(array_including(1,2))
end
The following changes fix what seems to be an issue: https://github.com/rspec/rspec-mocks/compare/master...papa-cool:master