failure to match #73

nbt opened this Issue Feb 16, 2011 · 2 comments

2 participants


I would expect the following to work. Instead, it fails with WebMock::NetConnectNotAllowedError.

require 'webmock/rspec'
include WebMock::API
describe "my_spec" do
  it "example1" do
    stub_request(:get, "").to_return(:body => "problem")
    Net::HTTP.get("", "/auto/wui/geo/GeoLookupXML/index.xml?query=41.0836882,-96.1343773")

However, it does work with the regex form:
stub_request(:get, %r{}).to_return(:body => "problem")


WebMock won't match uri without the full path specified.
You either have to specify full uri i.e. stub_request(:get, "") or use regex.


If you have any more questions feel free to send a message.

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment