WebMock v3.10.0 Release Notes
-
Added option to global stubs to have lower priority than local stubs.
WebMock.globally_stub_request(:after_local_stubs) do { body: "global stub body" } end stub_request(:get, "www.example.com").to_return(body: 'non-global stub body') expect(http_request(:get, "http://www.example.com/").body).to eq("non-global stub body")
Thanks to Marek Kasztelnik