Permalink
Browse files

Added missing spec which verifies that :allow with port doesn't allow…

… requests with a different port
  • Loading branch information...
bblimke committed Aug 8, 2011
1 parent c59c925 commit 518c840e6b59b942754f015bad0fedcdbfa43dba
Showing with 8 additions and 0 deletions.
  1. +8 −0 spec/webmock_shared.rb
View
@@ -153,6 +153,14 @@ class MyException < StandardError; end;
http_request(:get, "http://#{host_with_port}/").status.should == "200"
end
end
+
+ context "when the host is allowed but not port" do
+ it "should allow a real request to allowed host", :net_connect => true do
+ lambda {
+ http_request(:get, "http://localhost:123/")
+ }.should raise_error(WebMock::NetConnectNotAllowedError, %r(Real HTTP connections are disabled. Unregistered request: GET http://localhost:123/))
+ end
+ end
end
end

0 comments on commit 518c840

Please sign in to comment.