Sha256: 0f754341741642284da66dd000ff7155cc68b5e74023c147e04389ac443700c8

Contents?: true

Size: 871 Bytes

Versions: 45

Compression:

Stored size: 871 Bytes

Contents

RSpec.describe HTTP::Options, "new" do
  it "supports a Options instance" do
    opts = HTTP::Options.new
    expect(HTTP::Options.new(opts)).to eq(opts)
  end

  context "with a Hash" do
    it "coerces :response correctly" do
      opts = HTTP::Options.new(:response => :object)
      expect(opts.response).to eq(:object)
    end

    it "coerces :headers correctly" do
      opts = HTTP::Options.new(:headers => {:accept => "json"})
      expect(opts.headers).to eq([%w(Accept json)])
    end

    it "coerces :proxy correctly" do
      opts = HTTP::Options.new(:proxy => {:proxy_address => "127.0.0.1", :proxy_port => 8080})
      expect(opts.proxy).to eq(:proxy_address => "127.0.0.1", :proxy_port => 8080)
    end

    it "coerces :form correctly" do
      opts = HTTP::Options.new(:form => {:foo => 42})
      expect(opts.form).to eq(:foo => 42)
    end
  end
end

Version data entries

45 entries across 45 versions & 1 rubygems

Version Path
http-2.0.1 spec/lib/http/options/new_spec.rb
http-2.0.0 spec/lib/http/options/new_spec.rb
http-2.0.0.pre spec/lib/http/options/new_spec.rb
http-1.0.4 spec/lib/http/options/new_spec.rb
http-0.9.9 spec/lib/http/options/new_spec.rb
http-1.0.3 spec/lib/http/options/new_spec.rb
http-1.0.2 spec/lib/http/options/new_spec.rb
http-1.0.1 spec/lib/http/options/new_spec.rb
http-1.0.0 spec/lib/http/options/new_spec.rb
http-1.0.0.pre6 spec/lib/http/options/new_spec.rb
http-1.0.0.pre5 spec/lib/http/options/new_spec.rb
http-1.0.0.pre4 spec/lib/http/options/new_spec.rb
http-1.0.0.pre3 spec/lib/http/options/new_spec.rb
http-1.0.0.pre2 spec/lib/http/options/new_spec.rb
http-1.0.0.pre1 spec/lib/http/options/new_spec.rb
http-0.9.8 spec/lib/http/options/new_spec.rb
http-0.9.7 spec/lib/http/options/new_spec.rb
http-0.9.6 spec/lib/http/options/new_spec.rb
http-0.9.5 spec/lib/http/options/new_spec.rb
http-0.9.4 spec/lib/http/options/new_spec.rb