Sha256: 1e9dca9fbe64eb13a9ccefa00d69fe8944804dcd55b19c83a1bd5987207dbfb2

Contents?: true

Size: 681 Bytes

Versions: 11

Compression:

Stored size: 681 Bytes

Contents

require 'spec_helper'
require 'goliath/response'

describe Goliath::Response do
  before(:each) do
    @r = Goliath::Response.new
  end

  it 'allows setting status' do
    @r.status = 400
    @r.status.should == 400
  end

  it 'allows setting headers' do
    @r.headers = [['my_key', 'my_headers']]
    @r.headers.to_s.should == "my_key: my_headers\r\n"
  end

  it 'allows setting body' do
    @r.body = 'my body'
    @r.body.should == 'my body'
  end

  it 'sets a default status' do
    @r.status.should == 200
  end

  it 'sets default headers' do
    @r.headers.should_not be_nil
  end

  it 'outputs the http header' do
    @r.head.should == "HTTP/1.1 200 OK\r\n"
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
goliath-1.0.5 spec/unit/response_spec.rb
goliath-1.0.4 spec/unit/response_spec.rb
goliath-1.0.3 spec/unit/response_spec.rb
goliath-1.0.2 spec/unit/response_spec.rb
goliath-1.0.1 spec/unit/response_spec.rb
goliath-1.0.0 spec/unit/response_spec.rb
goliath-1.0.0.beta.1 spec/unit/response_spec.rb
goliath-0.9.4 spec/unit/response_spec.rb
goliath-0.9.2 spec/unit/response_spec.rb
goliath-0.9.1 spec/unit/response_spec.rb
goliath-0.9.0 spec/unit/response_spec.rb