Sha256: 6033582b56198d15560a06be0ab24d7238725fa42163f511bab2eabbcbc42fbc

Contents?: true

Size: 835 Bytes

Versions: 18

Compression:

Stored size: 835 Bytes

Contents

require File.dirname(__FILE__) + '/spec_helper'

describe Headers do
  before do
    @headers = Headers.new
  end
  
  it 'should allow duplicate on some fields' do
    @headers['Set-Cookie'] = 'twice'
    @headers['Set-Cookie'] = 'is cooler the once'
    
    @headers.to_s.should == "Set-Cookie: twice\r\nSet-Cookie: is cooler the once\r\n"
  end
  
  it 'should overwrite value on non duplicate fields' do
    @headers['Host'] = 'this is unique'
    @headers['Host'] = 'so is this'

    @headers.to_s.should == "Host: this is unique\r\n"
  end
  
  it 'should output to string' do
    @headers['Host'] = 'localhost:3000'
    @headers['Set-Cookie'] = 'twice'
    @headers['Set-Cookie'] = 'is cooler the once'
    
    @headers.to_s.should == "Host: localhost:3000\r\nSet-Cookie: twice\r\nSet-Cookie: is cooler the once\r\n"
  end
end

Version data entries

18 entries across 18 versions & 2 rubygems

Version Path
grockit-thin-0.8.2 spec/headers_spec.rb
thin-0.6.0-x86-mswin32-60 spec/headers_spec.rb
thin-0.6.4 spec/headers_spec.rb
thin-0.6.2-x86-mswin32-60 spec/headers_spec.rb
thin-0.6.0 spec/headers_spec.rb
thin-0.6.3 spec/headers_spec.rb
thin-0.6.1-x86-mswin32-60 spec/headers_spec.rb
thin-0.7.0-x86-mswin32-60 spec/headers_spec.rb
thin-0.6.2 spec/headers_spec.rb
thin-0.6.1 spec/headers_spec.rb
thin-0.6.3-x86-mswin32-60 spec/headers_spec.rb
thin-0.6.4-x86-mswin32-60 spec/headers_spec.rb
thin-0.7.1-x86-mswin32-60 spec/headers_spec.rb
thin-0.8.0 spec/headers_spec.rb
thin-0.8.1 spec/headers_spec.rb
thin-0.7.0 spec/headers_spec.rb
thin-0.8.2 spec/headers_spec.rb
thin-0.7.1 spec/headers_spec.rb