Sha256: 5a17130609b0fef01d1fb4f23d9a2889bb92e548fd2355b724c1ac4360b540e6

Contents?: true

Size: 519 Bytes

Versions: 1

Compression:

Stored size: 519 Bytes

Contents

require 'spec_helper'

describe Http::Options do
  subject { described_class.new(:response => :body) }

  it "behaves like a Hash for reading" do
    subject[:response].should eq(:body)
    subject[:nosuchone].should be_nil
  end

  it "it's gois able to coerce to a Hash" do
    subject.to_hash.should be_a(Hash)
    subject.to_hash[:response].should eq(:body)
  end

  it "raises ArgumentError with invalid options" do
    expect { subject.with_response(:notrecognized) }.to raise_exception(ArgumentError)
  end

end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
http-0.5.0.pre spec/http/options_spec.rb