webmock icon indicating copy to clipboard operation
webmock copied to clipboard

delete invalid uri like `127.0.0.1:3000/1234`

Open guppy0356 opened this issue 5 years ago • 0 comments

Versions:

webmock: 3.8.3 rspec: 3.5.4

Problem

ip address host which has no ports doesn't match request uri.

it "should match if Addressable::Template pattern that has ip address host without port matches request uri" do
  signature = WebMock::RequestSignature.new(:get, "127.0.0.1/1234")
  uri = Addressable::Template.new("127.0.0.1/{id}")
  expect(WebMock::RequestPattern.new(:get, uri)).to match(signature)
end

Workaround

Delete invalid string in the results of #matches_with_variations?.

guppy0356 avatar Jun 09 '20 03:06 guppy0356