Sha256: 6aafc274d81164bbeca925062e0db37dc642db809fb8dab9328a6e677d3603c9

Contents?: true

Size: 763 Bytes

Versions: 6

Compression:

Stored size: 763 Bytes

Contents

require 'spec_helper'

describe HTTP::Options, 'proxy' do

  let(:opts) { HTTP::Options.new }

  it 'defaults to {}' do
    expect(opts.proxy).to eq({})
  end

  it 'may be specified with with_proxy' do
    opts2 = opts.with_proxy(:proxy_address => '127.0.0.1', :proxy_port => 8080)
    expect(opts.proxy).to eq({})
    expect(opts2.proxy).to eq(:proxy_address => '127.0.0.1', :proxy_port => 8080)
  end

  it 'accepts proxy address, port, username, and password' do
    opts2 = opts.with_proxy(:proxy_address => '127.0.0.1', :proxy_port => 8080, :proxy_username => 'username', :proxy_password => 'password')
    expect(opts2.proxy).to eq(:proxy_address => '127.0.0.1', :proxy_port => 8080, :proxy_username => 'username', :proxy_password => 'password')
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
http-0.6.4 spec/http/options/proxy_spec.rb
http-0.6.3 spec/http/options/proxy_spec.rb
http-0.6.2 spec/http/options/proxy_spec.rb
http-0.6.1 spec/http/options/proxy_spec.rb
http-0.6.0 spec/http/options/proxy_spec.rb
http-0.6.0.pre spec/http/options/proxy_spec.rb