Sha256: 8fcc1bf427cbdc8269c0aa2ba6fc3f431dbb270df43053528b9b655d9e73b985

Contents?: true

Size: 1.08 KB

Versions: 27

Compression:

Stored size: 1.08 KB

Contents

require "spec_helper"

describe Net::HTTP do
  before do
    @some_uri = URI "http://example.com"
    @another_uri = URI "http://example.org"
    @http = Net::HTTP.new @some_uri.host, @some_uri.port
  end

  describe "endpoint" do
    it "changes the address and port of a Net::HTTP object" do
      @http.address.should == @some_uri.host
      @http.port.should == @some_uri.port

      @http.endpoint @another_uri.host, @another_uri.port
      @http.address.should == @another_uri.host
      @http.port.should == @another_uri.port
    end
  end

  describe "ssl_client_auth" do
    it "accepts a Hash of options for SSL client authentication" do
      @http.cert.should be_nil
      @http.key.should be_nil
      @http.ca_file.should be_nil
      @http.verify_mode.should be_nil

      @http.ssl_client_auth :cert => "cert", :key => "key",
        :ca_file => "ca_file", :verify_mode => OpenSSL::SSL::VERIFY_PEER

      @http.cert.should == "cert"
      @http.key.should == "key"
      @http.ca_file.should == "ca_file"
      @http.verify_mode.should == OpenSSL::SSL::VERIFY_PEER
    end
  end

end

Version data entries

27 entries across 27 versions & 6 rubygems

Version Path
savon-xaop-0.7.2.7 spec/savon/core_ext/net_http_spec.rb
savon-xaop-0.7.2.6 spec/savon/core_ext/net_http_spec.rb
johnreitano-savon-0.7.7.5 spec/savon/core_ext/net_http_spec.rb
johnreitano-savon-0.7.7.4 spec/savon/core_ext/net_http_spec.rb
johnreitano-savon-0.7.7.3 spec/savon/core_ext/net_http_spec.rb
johnreitano-savon-0.7.7.2 spec/savon/core_ext/net_http_spec.rb
tictoc-savon-0.7.9 spec/savon/core_ext/net_http_spec.rb
savon-xaop-0.7.2.5 spec/savon/core_ext/net_http_spec.rb
pyu-savon-0.7.9.3 spec/savon/core_ext/net_http_spec.rb
johnreitano-savon-0.7.7.1 spec/savon/core_ext/net_http_spec.rb
johnreitano-savon-0.7.2.1 spec/savon/core_ext/net_http_spec.rb
savon-xaop-0.7.2.4 spec/savon/core_ext/net_http_spec.rb
savon-xaop-0.7.2.3 spec/savon/core_ext/net_http_spec.rb
hoopla-savon-0.7.9 spec/savon/core_ext/net_http_spec.rb
savon-0.7.9 spec/savon/core_ext/net_http_spec.rb
savon-0.7.8 spec/savon/core_ext/net_http_spec.rb
savon-0.7.7 spec/savon/core_ext/net_http_spec.rb
savon-xaop-0.7.2.2 spec/savon/core_ext/net_http_spec.rb
hoopla-savon-0.7.6 spec/savon/core_ext/net_http_spec.rb
savon-0.7.6 spec/savon/core_ext/net_http_spec.rb