Sha256: 8967749cdeaf05f117e546ac19320f58e34f3f97eb2fdfc4365e1bb39fcc148f

Contents?: true

Size: 407 Bytes

Versions: 10

Compression:

Stored size: 407 Bytes

Contents

require "simple-http"

module RSpec::Httpd
  class Client < Simple::HTTP
    def initialize(host:, port:)
      super()
      self.base_url = "http://#{host}:#{port}"
    end

    attr_reader :response

    def content
      @response.content
    end

    private

    def execute_request(request, max_redirections: 10)
      @response = super(request, max_redirections: max_redirections)
    end
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
rspec-httpd-0.3.8 lib/rspec/httpd/client.rb
rspec-httpd-0.3.7 lib/rspec/httpd/client.rb
rspec-httpd-0.3.6 lib/rspec/httpd/client.rb
rspec-httpd-0.3.5 lib/rspec/httpd/client.rb
rspec-httpd-0.3.4 lib/rspec/httpd/client.rb
rspec-httpd-0.3.2 lib/rspec/httpd/client.rb
rspec-httpd-0.3.1 lib/rspec/httpd/client.rb
rspec-httpd-0.3.0 lib/rspec/httpd/client.rb
rspec-httpd-0.1.0 lib/rspec/httpd/client.rb
rspec-httpd-0.0.17 lib/rspec/httpd/client.rb