Sha256: a26eb44f9ed735870c38eff3e8600119adde0999c359a6bc2fd33727adc3abe2

Contents?: true

Size: 655 Bytes

Versions: 2

Compression:

Stored size: 655 Bytes

Contents

# encoding: utf-8

require 'spec_helper'

describe HTTPkit::Request do
  describe '#initialize' do
    subject do
      HTTPkit::Request.new(:get, '/a?b=c',
                           { 'Key' => 'value' }, 'hello').freeze
    end

    its(:http_method) { should be(:get) }
    its(:uri) { should eq('/a?b=c') }
    its(:headers) { should eq('Key' => 'value') }

    specify { expect(subject.body.to_s).to eq('hello') }

    describe 'defaults' do
      subject { HTTPkit::Request.new(:get, '/') }

      its(:headers) { should eq({}) }
      its(:http_version) { should eq(1.1) }

      specify { expect(subject.body.to_s).to be_empty }
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
httpkit-0.6.0 spec/unit/request_spec.rb
httpkit-0.6.0.pre.5 spec/unit/request_spec.rb