Sha256: c5a603ed7db23797922c5057595091dde8df48e3799f98f507fab4efd8e25ca7
Contents?: true
Size: 1.62 KB
Versions: 34
Compression:
Stored size: 1.62 KB
Contents
require 'spec_helper' describe "errors" do describe WebMock::NetConnectNotAllowedError do describe "message" do it "should have message with request signature and snippet" do request_signature = mock(:to_s => "aaa") request_stub = mock WebMock::RequestStub.stub!(:from_request_signature).and_return(request_stub) WebMock::StubRequestSnippet.stub!(:new). with(request_stub).and_return(mock(:to_s => "bbb")) expected = "Real HTTP connections are disabled. Unregistered request: aaa" + "\n\nYou can stub this request with the following snippet:\n\n" + "bbb\n\n============================================================" WebMock::NetConnectNotAllowedError.new(request_signature).message.should == expected end it "should have message with registered stubs if available" do request_signature = mock(:to_s => "aaa") request_stub = mock WebMock::StubRegistry.instance.stub!(:request_stubs).and_return([request_stub]) WebMock::RequestStub.stub!(:from_request_signature).and_return(request_stub) WebMock::StubRequestSnippet.stub!(:new). with(request_stub).and_return(mock(:to_s => "bbb")) expected = "Real HTTP connections are disabled. Unregistered request: aaa" + "\n\nYou can stub this request with the following snippet:\n\n" + "bbb\n\nregistered request stubs:\n\nbbb\n\n============================================================" WebMock::NetConnectNotAllowedError.new(request_signature).message.should == expected end end end end
Version data entries
34 entries across 34 versions & 3 rubygems