Sha256: b47fdf37584727ad79a1a002cd9f97a32bb40250c7faeb1b4793579ac37cf16b

Contents?: true

Size: 567 Bytes

Versions: 5

Compression:

Stored size: 567 Bytes

Contents

module WebMock
  
  class NetConnectNotAllowedError < StandardError
    def initialize(request_signature)
      text = "Real HTTP connections are disabled. Unregistered request: #{request_signature}"
      text << stubbing_instructions(request_signature)
      super(text)
    end

    private

    def stubbing_instructions(request_signature)
      text = "\n\n"
      text << "You can stub this request with the following snippet:\n\n"
      text << WebMock::StubRequestSnippet.new(request_signature).to_s
      text << "\n\n" + "="*60
      text
    end
  end

end

Version data entries

5 entries across 5 versions & 2 rubygems

Version Path
vanity-1.7.1 vendor/ruby/1.9.1/gems/webmock-1.6.4/lib/webmock/errors.rb
webmock-1.6.4 lib/webmock/errors.rb
webmock-1.6.2 lib/webmock/errors.rb
webmock-1.6.1 lib/webmock/errors.rb
webmock-1.6.0 lib/webmock/errors.rb