Permalink
Browse files

remove_stub renamed to remove_request_stub

  • Loading branch information...
1 parent 55e062e commit e294efd1072d64c171c7402be71e563b9722503e @douglascamata committed Sep 13, 2012
Showing with 4 additions and 4 deletions.
  1. +1 −1 lib/webmock/api.rb
  2. +3 −3 spec/acceptance/shared/stubbing_requests.rb
View
@@ -7,7 +7,7 @@ def stub_request(method, uri)
register_request_stub(WebMock::RequestStub.new(method, uri))
end
- def remove_stub(method, uri)
+ def remove_request_stub(method, uri)
WebMock::StubRegistry.instance.
unregister_request_stub(WebMock::RequestStub.new(method, uri))
end
@@ -452,15 +452,15 @@ def stub_non_globally
end
it "should be able to remove a previously stubbed uri" do
- WebMock.remove_stub(:get, "www.example.com")
+ WebMock.remove_request_stub(:get, "www.example.com")
lambda {
http_request(:get, "http://www.example.com/")
}.should raise_error(WebMock::NetConnectNotAllowedError, %r(Real HTTP connections are disabled. Unregistered request: GET http://www.example.com/))
end
it "should only remove the stub with the specified verb" do
stub_request(:post, "www.example.com")
- WebMock.remove_stub(:get, "www.example.com")
+ WebMock.remove_request_stub(:get, "www.example.com")
lambda {
http_request(:get, "http://www.example.com/")
}.should raise_error(WebMock::NetConnectNotAllowedError, %r(Real HTTP connections are disabled. Unregistered request: GET http://www.example.com/))
@@ -469,7 +469,7 @@ def stub_non_globally
it "should only remove the stub with the specified uri" do
stub_request(:get, "www.another.example.com")
- WebMock.remove_stub(:get, "www.example.com")
+ WebMock.remove_request_stub(:get, "www.example.com")
lambda {
http_request(:get, "http://www.example.com/")
}.should raise_error(WebMock::NetConnectNotAllowedError, %r(Real HTTP connections are disabled. Unregistered request: GET http://www.example.com/))

0 comments on commit e294efd

Please sign in to comment.