Sha256: 60ba33b0bc05495df14b7eae398ca73c2f375559b768efc78f8229f6a1f5c352

Contents?: true

Size: 1.2 KB

Versions: 48

Compression:

Stored size: 1.2 KB

Contents

require File.expand_path('../../../../../spec_helper', __FILE__)
require 'net/http'
require File.expand_path('../fixtures/http_server', __FILE__)

describe "Net::HTTP.Proxy" do
  it "returns a new subclass of Net::HTTP" do
    Net::HTTP.Proxy("127.0.0.1").should < Net::HTTP
  end

  it "returns Net::HTTP when the passed address is nil" do
    Net::HTTP.Proxy(nil).should == Net::HTTP
  end

  it "sets the returned subclasses' proxy options based on the passed arguments" do
    http_with_proxy = Net::HTTP.Proxy("127.0.0.1", 1234, "rspec", "rocks")
    http_with_proxy.proxy_address.should == "127.0.0.1"
    http_with_proxy.proxy_port.should eql(1234)
    http_with_proxy.proxy_user.should == "rspec"
    http_with_proxy.proxy_pass.should == "rocks"
  end
end

describe "Net::HTTP#proxy?" do
  describe "when self is no proxy class instance" do
    it "returns false" do
      Net::HTTP.new("127.0.0.1", NetHTTPSpecs.server_port).proxy?.should be_false
    end
  end

  describe "when self is a proxy class instance" do
    it "returns false" do
      http_with_proxy = Net::HTTP.Proxy("127.0.0.1", 1234, "rspec", "rocks")
      http_with_proxy.new("127.0.0.1", NetHTTPSpecs.server_port).proxy?.should be_true
    end
  end
end

Version data entries

48 entries across 48 versions & 2 rubygems

Version Path
rhodes-7.6.0 spec/framework_spec/app/spec/library/net/http/http/proxy_spec.rb
rhodes-7.5.1 spec/framework_spec/app/spec/library/net/http/http/proxy_spec.rb
rhodes-7.4.1 spec/framework_spec/app/spec/library/net/http/http/proxy_spec.rb
rhodes-7.1.17 spec/framework_spec/app/spec/library/net/http/http/proxy_spec.rb
rhodes-6.2.0 spec/framework_spec/app/spec/library/net/http/http/proxy_spec.rb
rhodes-6.0.11 spec/framework_spec/app/spec/library/net/http/http/proxy_spec.rb
rhodes-5.5.18 spec/framework_spec/app/spec/library/net/http/http/proxy_spec.rb
rhodes-5.5.17 spec/framework_spec/app/spec/library/net/http/http/proxy_spec.rb
rhodes-5.5.15 spec/framework_spec/app/spec/library/net/http/http/proxy_spec.rb
rhodes-5.5.0.22 spec/framework_spec/app/spec/library/net/http/http/proxy_spec.rb
rhodes-5.5.2 spec/framework_spec/app/spec/library/net/http/http/proxy_spec.rb
rhodes-5.5.0.7 spec/framework_spec/app/spec/library/net/http/http/proxy_spec.rb
rhodes-5.5.0.3 spec/framework_spec/app/spec/library/net/http/http/proxy_spec.rb
rhodes-5.5.0 spec/framework_spec/app/spec/library/net/http/http/proxy_spec.rb
tauplatform-1.0.3 spec/framework_spec/app/spec/library/net/http/http/proxy_spec.rb
tauplatform-1.0.2 spec/framework_spec/app/spec/library/net/http/http/proxy_spec.rb
tauplatform-1.0.1 spec/framework_spec/app/spec/library/net/http/http/proxy_spec.rb
rhodes-3.5.1.12 spec/framework_spec/app/spec/library/net/http/http/Proxy_spec.rb
rhodes-3.3.5 spec/framework_spec/app/spec/library/net/http/http/Proxy_spec.rb
rhodes-3.4.2 spec/framework_spec/app/spec/library/net/http/http/Proxy_spec.rb